You can't tell which is bad until you actually change the filter then test the fuel pressure.
Generally, fuel filters become plugged by fuel sediment contamination and over time, gradually restrict free flow of the fuel. Symptoms of restricted fuel flow are reduced engine performance and poor drivability, such as hesitation upon acceleration. As the fuel restriction becomes worse the engine may even "buck" or surge severely under normal acceleration. Without going into advanced procedures and special equipment required for fuel pressure testing, for the average "shade tree" mechanic the symptoms descirbed lead to the "fairly" easy/routine service of changing the fuel filter. Once the fuel filter is removed, a simple side by side comparison test can be made by blowing gently through the filters, typically the restriction becomes readily apparent when compared to the new filter, as there is virtually no opposition to air flow when blowing through the filters. If you have the skills to safely disable the ignition and rig a clear hose to the open end of the fuel line and an acceptable (safe) container you can then check to see if fuel is free flowing, however caution definitely is the rule if attempting this test, due to fire hazard of fuel in the presence of ignition sources. (i.e., Do not attempt unless you are trained and familiar with safe practices). Once, the fuel filter is replaced road test the vehicle and if the problem is no longer present this will be confirmation that the problem was the fuel filter and not the fuel pump.