On heating, air expands, and hence its density:
Water on heating from 0 ∘C to 4 ∘C contracts and on further heating it expands.
On heating a metal it contracts while on cooling it expands.