1999 Ford Contour jerking when driving accelerating slowing down

Hi, I was driving the car yesterday and was getting on the highway ramp and stepped on the gas and car went crazy. It started to accelerate and decelerate by itself. I had no control of the car whatsoever. When driving at 0 to 40mph no problem so far, but anything over this car will jerk, like it’s changing gears by itself, ‘going fast and slow.’
What is this? Do I need a fuel filter, or plugs or what? I don’t know when the last time I changed anything the car mileage is 135,000
Help

I’d start with the fuel filter as that is a common way a clogged filter rears its ugly head. It is cheap and usually pretty easy to do.