The engine revs up and then down and up and then down and it doesn’t stop and is downright annoying not to mention that it affects the power output of your lawn mower.
This surging is normally caused by a fuel problem or more specifically, a lack of fuel problem. Something is preventing the gasoline from getting into the engine.
Most likely it is a plugged up idle jet that is causing the fuel not to get into the engine. Idle jets are smaller in size and plug up more easily. So the carburetor will need to be taken apart and thoroughly cleaned. You also want to make sure that there is no air leak where the carburetor attaches to the engine or in the intake as well. An air leak will cause this surging as well.
Now you can reassemble your carburetor onto the engine and then test it to see if it has fixed the problem. You should have no more surging and it should run smooth like it should in normal operation.
If it does not, you may have to replace the carburetor as that is the best course of action if you cannot get it completely clean.