Mazda Protege 2000 Slowing Down

Hello all, I’m not at all car savvy and was hoping to get some feedback from you in regards to my car problem. My Mazda has had several issues lately and I’ve tried to fix them mainly because I cannot afford a new car at the moment… Most recently the AC compressor gave out and it was fixed. However, recently I was driving on the Florida turnpike around 70 mph when the car began to decelerate even though I was pressing on the gas pedal. the speed went down to 40 mph and stayed like that for a minute, then it started accelerating back to 70 mph and stayed like that for about 3 min before decelerating again back to 40 mph. I ended up getting off the turnpike and taking a much longer route that would allow me to drive no more than 45 mph. This was not the first episode this occurred. The previous day, the car stayed at 40 mph for about 5 minutes of getting on to the highway. After 5 minutes it drove fine and I figured it just needed some time. Every time this issue occurred, I looked at the temperature gauge and it looked normal. Can you guys give some advise on what the issue could be?