Why is density constant?
Density is NOT constant, but for liquids and solids it doesn't change very much with temperature or pressure.
Most gases obey (at least approximately) the ideal gas law:
which can be rearranged to show that the density of a gas is proportional to pressure and inversely proportional to temperature:
Liquids and solids expand only slightly with increasing temperature, and they compress only slightly with increasing pressure, so their densities are approximately constant under most ordinary conditions.
Really good examples that focuses on solids and liquids can be on this site http://chemistry.elmhurst.edu/vchembook/120Adensity.html