How does the density of water change as a function of tempreture?
this is from memory so might be a bit off: water is denser as it gets colder, down to 4 degrees C, then from 4 down to freezing it gets less dense, therefore ice floats on cold water, which surprisingly helps make life possible because if ice sank then the oceans would fill with ice from the bottom up, it would never thaw and each winter would build more ice until practically the whole world would be frozen solid instead, ice floats on top insulating the water below from the cold winter air and allowing life to survive something like that
As water is heated it expands and becomes lighter per unit of volume. This is why your hot water heater has a dip tube in the cold water inlet that brings the cold water to the bottom of the tank. As it heats it becomes lighter and rises to the top of the tank. This is why when you turn on the hot water, if you run it long enough, you will exhaust the hot and just get cold water.. A peculiarity of water is that when it gets cold it gets denser until it freezes, then it expands as ice to become lighter per unit of volume than the water it floats in until it all freezes. This is why in winter time unprotected water lines freeze, then burst.