Hint $ $ Induction step: $\rm\:24\:|\:f(n) = n^3\!-n\:\Rightarrow\:24\:|\:f(n\!+\!2) = f(n) + 6(n\!+\!1)^2\:$ by $\rm\:n\!+\!1\:$ is even.
Remark $\ $ If we telescsope this we obtain a nice representation showing the factor of $24$.
$$\rm\begin{eqnarray} f(2n\!+\!1)\! -\! f(1)\, &=&\,\rm f(2n\!+\!1)\!&&\rm-\ f(2n\!-\!1) &&\rm+\ \,\cdots\, + f(5)\!&&\rm-\ f(3) &&\rm +\ \ f(3)\!&&\rm-\ f(1) \\
\,&=&\,\rm &&\!\!\!\!\!\rm6(2n)^2&&+\ \,\cdots\, + &&\!\!\!6\cdot4^2&& +&&\!\!\!6\cdot2^2\end{eqnarray}$$
So, using $\rm\:f(1) = 0,\:$ and pulling out a factor of $\,4\,$ from the RHS via $\rm\,(2k)^2 = 4\cdot k^2$ we obtain
$$\rm\ f(2n\!+\!1)\, =\, 24\, (n^2 + (n\!-\!1)^2 +\, \cdots\, + 2^2 + 1^2)$$
making the factor of $24$ clear. This is essentially the result in Thomas's answer except that we have derived it mechanically (requiring no insight or special knowledge), using only the very simple idea of telescopy - about which you can find much more written in many of my prior posts on telescopy.