There are basically two types of temperature gauges, electric and mechanical. Today's cars use electrical gauges but not too many years ago many used mechanical gauges that operated with a Bourdon Tube.
The Bourdon Tube
A Bourdon Tube is a thin metal - usually brass or copper - tube that is filled with an easily vaporized fluid, typically alcohol. It is sealed at both ends. At the gauge end it is formed into a circle or spiral with its end attached to the indicating needle by some form of linkage. The other end is fitted to a water-tight connector that is in direct contact with the coolant in the engine.
As the coolant warms up the alcohol in the Bourdon tube expands. The expansion transfers its force to the coiled end of the tube inside the gauge. As the coil or spiral unwinds it pulls the linkage on the needle, which in turn shows a temperature reading on the gauge face. The gauges are calibrated during the manufacturing stage and are not adjustable afterward.
Since the Bourdon Tube design is purely mechanical the gauge will continue to read some temperature level even after the engine is shut off. As the engine cools the gauge's needle will return to its rest position.
Bourdon Tube gauges aren't used anymore because of cost and convenience factors. The tubes are delicate and must be carefully routed from the dash to the appropriate fitting on the engine. The gauges themselves are far more expensive than electric or electronic gauges and if the tube is kinked or split the entire gauge assembly must be replaced.