Which of my water heater's thermostats is broken?
The typical dual-element, dual-thermostat water heater in the United States is a "non-simultaneous" design: first the upper element heats the top of the tank to the set temperature, then the upper thermostat switches power to the lower thermostat, which uses the lower element to heat the rest of the tank.  There's never more than one element active at a time.

   

The picture on the left is the upper thermostat for a typical water heater; the schematic on the right shows both the upper and lower thermostats.  The switches are in the positions you'd find them on a hot tank with both thermostats working.  Note that point "T6" in the schematic is on the right and T7 is on the left, while on most actual thermostats, it's the other way around.  T6 is the terminal with a single wire connected to the upper element, while T4 connects to both elements and T7 connects to the lower thermostat.

Testing with a multimeter

If you've got a multimeter, it's easy; you don't need to disconnect any wires or anything.  Let the tank heat up for a while until the water is well above the thermostat set point, then shut off power to it.  If the upper thermostat is the one that's stuck, you'll have a pretty steep temperature gradient in the tank, so let the tank sit for an hour or so.

You may wish to switch both thermostats to their minimum setting.  This will make it more likely that the tank is hot enough that both should be switched off, but it also carries the risk of opening the stuck contact, leaving you with a questionable thermostat and no way to identify it.

Set your multimeter for the highest AC voltage range, and measure the voltage between points T1 and T2, between T1 and the tank body, and T2 and the tank body.  All three measurements should be less than one volt; if any is higher than that, power to the water heater is still live, and you should call an electrician to investigate that before you proceed with figuring out which thermostat is broken.

Now that you've verified that power is off, set your multimeter to the lowest "ohms" or "resistance" setting that will cover the 0 to 50 ohm range.  Measure the resistance between points T5 and T6 (if your upper thermostat doesn't have a terminal in the T3 or T5 position, make sure the limit switch has been reset, and measure between T1 and T6).  If you've set everything up right and the tank is above the thermostat set points, if the multimeter reads:


open circuit: Both thermostats working
less than 1 ohm: Upper or both thermostats stuck closed
20-30 ohms or so: Lower thermostat stuck closed


If the upper thermostat is stuck, you'll need to make a second measurement to see if the lower thermostat is broken as well.  Measure the resistance across the lower thermostat's terminals.  If it's less than 1 ohm, the lower thermostat is stuck closed or you didn't heat the tank up enough; if it's an open circuit, the thermostat is working.

Testing with a voltmeter

If you've got a voltmeter, you can determine which thermostat is broken, but it involves working with live wires.

Heat the tank as described in the "multimeter" section, but after letting the tank sit, turn the power back on.  Set your voltmeter to the highest AC voltage range.  Measure the voltage across the terminals of the lower thermostat, across T5 and T6, and across T5 and T7.  These measurements should be near either 0V or line voltage:


Lower thermostat: line voltage, T5-T6: line voltage, T5-T7: 0V: Both thermostats working
Lower thermostat: 0V, T5-T6: 0V, T5-T7: 0V: Upper thermostat stuck closed.
Lower thermostat: 0V, T5-T6: line voltage, T5-T7: 0V: Lower thermostat stuck closed.
Lower thermostat: 0V, T5-T6: 0V, T5-T7: line voltage: Both thermostats stuck closed.


Testing with a non-contact voltage tester

If all you've got is a non-contact voltage tester, things are harder: the results are less clear-cut, and it requires working around live wires.

Heat the tank as described in the "multimeter" section, but after letting the tank sit, turn the power back on.  Check the wire connecting the upper and lower thermostats (the "runner") with the NCV.  If it doesn't show a voltage, the upper thermostat is stuck.  If it does, proceed with the next step.

Shut off power to the water heater, disconnect the runner from the upper thermostat, cover the exposed end with something insulating (a wire nut or electrical tape), and turn power back on.  Check the runner again with the NCV.  If it doesn't show a voltage, both thermostats are working.  If it does, then the lower thermostat is stuck (or the NCV is picking up induced voltage -- I said this was less clear-cut than using a multimeter).