In the following derivation, I just calculated the absolute internal energy of an ideal gas as a function of its temperature. But my teacher said that we can never calculate the absolute internal energy in thermodynamics. Then how is the below proof correct?
Proof to calculate absolute internal energy:
We know that from the law of equipartition of energy, average energy ($E_\mathrm{avg}$) can be written as, \begin{align} E_\mathrm{avg} &= \frac{f}{2}k_\mathrm bT \\ E_\mathrm{avg}(n\, \mathrm{mol}) &= nN_A\frac{f}{2}k_\mathrm bRT \\ &=\frac{f}{2}nRT \tag{1} \end{align}
Therefore, average energy for n moles of gas molecules is $\frac{f}{2}nRT$.
In case of an ideal gas, $$E_\mathrm{total} = K.E$$ Since there are no interactive forces, $P.E = 0$ and other energies are negligible. Therefore internal energy is equal to the kinetic energy.
From (1), we get: $$U_\mathrm{ideal} = K.E_\mathrm{ideal} = \frac{f}{2}nRT$$