Check engine light in 96 subaru legacy

When driving about 60 mph my car will begin to studder and then my check engine light will blink and stay on. This usually happens once per trip and then the car drives fine after that. Latley it has been happening most every time I get up to 60mph. Car studder, light blink, light stay on. Someone said I might be putting in bad gas. or maybe I need a new fuel filter. Not sure and would like some advise

The possibilities are very numerous, and as a result any speculation is not going to be helpful to you unless you just want to “throw parts at it”, based on random suggestions.

What you need to do is to have the stored trouble code(s) read, as that will provide some very tangible clues to the real source of the problem. If you go to Auto Zone, Advance Auto, O’Reilly, Napa, or other parts retailer, you should be able to have the code(s) read free-of-charge. Then, you can come back to this thread (bookmark it so that you can find it again), and post the code(s) for specific advice.