A free piston keeps the gas pressure fixed, so heating it is a constant-pressure process from Work Done by a Gas. The first step is always a force balance on the piston. Each problem here is one short scene and a chain of questions. Answer them in order: each later question uses what you found before, so a slip early on carries through. Keep full precision between steps and round only at the end.
🔑 Key idea
$$p = p_0 + \frac{Mg}{A}, \qquad \frac{V_2}{V_1} = \frac{T_2}{T_1}\ (\text{constant } p), \qquad W = p\,\Delta V.$$ For a monatomic ideal gas at constant pressure, $Q = \tfrac{5}{2}p\,\Delta V$ (that is $\Delta U = \tfrac{3}{2}p\,\Delta V$ plus the work).
The piston stays balanced the whole time, so the pressure never changes; the gas just takes up more room.
✏️ Worked example: Warming the gas
A $40\ \text{kg}$ piston of area $0.02\ \text{m}^2$ sits $30\ \text{cm}$ above the base, with outside air at $1.0 \times 10^5\ \text{Pa}$. The gas warms from $300\ \text{K}$ to $400\ \text{K}$. Find (1) the pressure, (2) the new height, (3) the work.
Leaving out the air pressure on top: $p = Mg/A$ alone. The atmosphere pushes down on the piston too. Check: with a massless piston the gas would still be at air pressure, not zero.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.