Thanks, since it turned out to be fairly inexpensive, I replaced the temperature sensor. The one on the car seemed like it was the original anyway (subsequently it appears that Mercedes has replaced the old model with a newer version.).
However, the temperature gauge is still jumping up and down rapidly, dropping dead for a while, twitching ,then jumping again, and making a rattling noise. Have you any ideas on where to check for a loose ground? I only have a Chilton repair manual handy and it has nothing specific about these electrical parts.