I wanted to know why molarity is temperature-dependent whereas molality is temperature-independent.
This happens because molarity is number of moles per volume of solution and molality is number of moles per mass of the solvent. Now, volume is temperature dependent property since most substances expand with increase in temp and vice versa. Hence the ratio of moles to volume change with temperature. But mass is a temperature independent property hence it does not change with temperature unless the substance or the solvent is getting evaporated constantly due to the conditions in which it is kept. Hence molarity is temperature dependent whereas molality is not.