I would be grateful if somebody could explain to me what the AC and DC coupling button on a oscilloscope is for, and in what situations would I use it.
Imagine you are measuring on the buffer capacitor right after the bridge rectifier in a powersupply.
If the oscilloscope is in DC coupling, you could see the DC voltage in this capacitor.
If the oscilloscope is in AC coupling, you could see the AC (ripple) on this capacitor.
Generally speaking, you will use the scope with the input coupling set for DC.
In this manner you will be able to measure true DC voltages.
Now suppose you have a 1mV ripple on top of a 10VDC signal (as in the example given by bertus above), you will not be able to see or measure this ripple voltage. You need to remove the constant DC voltage. This is what the AC coupling does. It removes the DC and allows you to observe the AC component of the signal.
Another way of putting it, consider all signals to consist of DC + AC components.
The DC coupling allows you to observe both DC + AC.
The AC coupling allows you to observe AC component only.
The AC mode simply places a capacitor in series with the input to block DC. Thus the frequency response rolls off at some low frequency, appearing as a high-pass filter. This rolloff frequency varies somewhat with the particular oscilloscope design but likely is somewhere between 1 to 10 Hz. This is lowered by a factor of 10 if a 10:1 probe is being used.