The photos below are of one of the relatively newer plastic speedo/odo mechanisms. The metal framed older ones have a similar reset mechanism, although the overall layout is a bit different.

Here you can see the trip odometer gears engaged. The gear at the right is the drive gear, and you can see how the small gear at the lower right normally links it to the 1/10's wheel.


Below is a picture as the reset button is just starting to be pressed. The first thing that happens is the row of linking gears is moved away so the counting wheels are free to turn and be reset.

Shortly after, small arms push on cams which are part of the counting wheels. These cams are set to turn the wheels back to zero. Depending on where the wheel is positioned, it could turn "up" or "down" while being reset. Basically, if it's on 0-4 it goes one way, 5-9, the other.

Note that a bit of friction between the 1/10's wheel and the driving gear will still be present, since they rub against each other. This is the only force going from the trip odometer mechanism back toward the driving gears. If your trip odometer breaks while pressing the reset button, it isn't because you're moving. The speed of the counting wheels turning while being reset is very much greater than the speed that the drive gear turns, so being in motion adds only a infinitesimal amount of additional friction to things, and only half the time (because the other half of the time, they're turning in the same direction, so it reduces friction).



Below is a picture of the main odometer drive gear. If this starts slipping on the shaft, your odometer and trip odometer will stop working. A bit of green threadlocker between the shaft and gear should fix it right up. The metal framed ones are similar, but it's harder to reach the gears.