Mercury is used in thermometers to measure temperature because:
It changes color with temperature
It expands or contracts with temperature
All of the above
Mercury, being a metal is a good conductor of heat and remains liquid at room temperature and can flow. So, as the temperature of mercury increases, it expands and the length of the mercury column increases. Also, it is shiny (so easily visible) and does not stick to the walls of test-tube and multiple readings can be taken in a short time.
Mercury changes state with the change in temperature, but if the change in state is used to indicate the temperature it can only show two temperatures where the mercury melts and boils. The property of thermal expansion is used to accurately measure the temperature between the melting and boiling points of mercury.