Chemistry - Temperature dependence of molarity and molality
Solution 1:
Recall that molarity $c$ is
$$c=\frac{n_\text{solute}}{V_\text{solution}}$$
whereas for molality $b$ is
$$b=\frac{n_\text{solute}}{m_\text{solvent}}$$
While in the extreme case you mentioned, both quantities are not defined because all the solvent is either boiled away (or for heat-sensitive species, the solvent can even decompose under heating), molarity depends on volume, and the volume of the solution depends on temperature due to expansion/contraction.
Solution 2:
Example: 5 moles of solute in 1 liter of solution.
The Molarity at the beginning is (5moles ÷ 1Liter) = 5 M.
When the solution is warmed up and expanded by 1% say, to 1.01L, the new Molarity = (5moles ÷ 1.01Liter) = 4.95 M
P.S. Don't over think this question! The amount of content should not change, all you're talking about is expansion of content when the temperature rises. All matter expands when temperature rises so if you're calculating the molarity of a solution, you may get different readings on a warm day compared to a freezing cold day!
Molality doesn't change with temperature...