Solution (source code)

= Solution

Keep the chemical potential at its zero-temperature value $\mu=E_F$ and put $E'=E-E_F$. Away from $E'=0$,
$$
f(E)-\mathbf1_{E<E_F}
=\frac12\left[\operatorname{sgn}\!\left(\frac{\beta E'}2\right)
-\tanh\!\left(\frac{\beta E'}2\right)\right].
$$
Consequently
$$
\Delta N
=X\int_{-E_F}^{\infty}
\left[\operatorname{sgn}\!\left(\frac{\beta E'}2\right)
-\tanh\!\left(\frac{\beta E'}2\right)\right]dE',
$$
where
$$
\boxed{X=\frac g2=\frac{Am}{2\pi\hbar^2}}.
$$

The bracket is an odd function localized to $|E'|\lesssim k_BT$. When $\beta E_F\gg1$, extending the lower limit to $-\infty$ makes the integral vanish exactly. The omitted tail is exponentially small; indeed direct integration gives
$$
\Delta N=\frac g\beta\log(1+e^{-\beta E_F}).
$$
This is the <low-temperature particle-number cancellation for constant density of states>.

For the energy,
$$
\begin{aligned}
\Delta E_{\rm tot}
&=g\int_{-E_F}^{\infty}(E_F+E')
\bigl[f(E_F+E')-\mathbf1_{E'<0}\bigr]dE'\\
&=E_F\Delta N
+X\int_{-E_F}^{\infty}E'
\left[\operatorname{sgn}\!\left(\frac{\beta E'}2\right)
-\tanh\!\left(\frac{\beta E'}2\right)\right]dE'.
\end{aligned}
$$
At low temperature the first term is exponentially small. In the second, extend the lower limit to $-\infty$ and set $z=\beta E'/2$:
$$
\Delta E_{\rm tot}
\sim\frac{4X}{\beta^2}
\int_{-\infty}^{\infty}z[\operatorname{sgn}(z)-\tanh z]\,dz.
$$
The remaining integral is a finite positive constant, proving the <quadratic low-temperature energy correction for constant density of states>:
$$
\boxed{\Delta E_{\rm tot}\propto\beta^{-2}\propto T^2}.
$$