Welcome to the forum!
The fuel filter is located inboard of the right-rear wheel, under a cover. It is a large silver cylinder, not to be confused with the fuel pump that has wiring going to it.
If it has been a long time since changing the fuel filter, that is a good thing to do. It does sound like a fuel starvation problem.
Additionally, since this is happening hot or cold, you might want to make sure your air filter is clean and while there check the air mass sensor plate. Make sure it is clean as well. If dirty, carefully wipe the plate off and also the surrounding sides.
It is hard to guess what is up .... It could be moisture in your fuel tank ... is the problem temperature/moisture related? You could try adding a dry gas additive.
You might want to verify your cap and rotor for starters.
I am presuming the car has been properly serviced (plugs etc .....)
How many miles on the car?
Keep us posted,
'03 E320 Wagon-Sold
'95 E320 Wagon-Went to Ex
'93 190E 2.6-Wrecked
'91 300E-Went to Ex
'65 911 Coupe (#302580)