Fact 1: a thermometer is used to measure temperature. 
Fact 2: When the temperature rises, the mercury expands and rises in the thermometer tube.
Mercury expanding and rising in a tube is used to measure temperature.