Welcome to TRS
No, not the alternator if engine idle is going up and down, but alternator could have one field out, first the engine idle.
Fuel injected engines can't use carb type idle screws, no jets, so they use an IAC Valve(idle air control valve) instead.
The computer monitors RPM with a sensor on the crankshaft(CKP), on the upper intake near the throttle plate is where the IAC Valve is, the computer opens this valve a bit and idle goes up, closes it a bit and idle goes down, the valve is letting more or less air past the throttle plate.
On a cold engine computer is programmed to idle at approx. 1,000rpm(varies by temperature)
On warm engine 750rpm
The IAC valve can get sticky, so computer has to open and close it to try and get a stable idle, if valve is sticking then computer is trying to play catch up.
Good news is that the IAC valve is easy to clean.
You could also have a vacuum leak that is effecting the idle.
The first thing to try is to warm up engine then unplug the IAC Valves connector, idle should drop down to approx. 500, there is a screw on the throttle linkage to set this if engine dies when IAC is unhooked, but set it so idle is between 500-600, no higher.
If idle is no longer surging with IAC unhooked then clean the IAC Valve, it is causing the surging.
If idle still surges then find the vacuum leak.
It could even be a dirty PCV Valve with a sticky ball
An alternator has 3 fields that generate AC Voltage, the AC is converted to DC by a pair of Diodes, each field is separate, and their DC voltage is combined in another circuit.
Factory alternators produce enough voltage at idle(750rpm minimum) to power all standard equipment without lights dimming, if you add lights, subwoofer amps or other electrics then lights may dim at idle, doesn't hurt anything but that's why they dim.
But lights dimming at idle with stock electrics usually means one field has stopped working, since you spend more time above idle while driving the battery will stay charge with only 2 fields working, alternator can produce more voltage at higher rpms to compensate for failed field, and it can last years this way.
Once idle is stable put a volt meter on the battery, with engine off battery should show 12.3-12.8volts, below 12.3v means battery can only hold 50% charge, so a cold morning or a few times cranking engine could give you the dreaded "click, click, click" of a battery without enough amps to turn starter.
Start engine, battery voltage should now be above 14volts, that is the alternator/voltage regulator recharging battery from start up.
After a few minutes battery should be recharged and voltage should drop to approx. 13.6volts, that's the alternator/voltage regulator maintaining the battery's charge, maintenance charge is about 1 volt above battery's at rest voltage.
If battery gets 14v or higher for long period it will be ruined, the liquid in the battery will start to evaporate, it is not technically boiling but that is what people often refer to it as, boiling battery dry by over-charging it.
Once voltage is at 13.6v turn on all the vehicles electrics, lights, heater fan(high), leave door open, radio, anything else you can think of.
Battery voltage will drop each time something is turned on, and then come back up to 13.6v, that's the voltage regulator seeing the power draw and increasing the output voltage of the alternator.
If battery voltage starts to drop and not come back up to 13.6v then you probably have a field that is not working, so as the voltage drops you "see" lights dimming.