Honda Civic LX 1998 auto 4 door fluctuating Idle turned on check engine light

I recently bought this Civic and have to get it inspected, after charging the battery and installing a new radiator with all fresh fluids, the car started great. Then today I started it to check if the cold weather drained the battery, it didn't, but after a couple minutes of idling, it started revving from 1.25 to 2.5 rmp up and down, then the check engine light came on. The weird thing is it that it idles and acts fine in Drive or Reverse. Anyone have a clue on where I can find the problem or how to fix it?

Get someone to get code that turned on check engine light (CEL). Most auto part stores will read the code for free. It will give you a clue as to what the problem might be. The codes are stored even if CEL goes off on its own.

No… You have the vehicle. Go get the codes read. That's what the check engine light is for.