prove that $24 \mid a(a^2-1)$

Since $a$ is an odd integer, $a=2n+1$ where $n\ge0$ is an integer.

$a(a^2-1)=(2n+1)(4n^2+4n+1-1)=(2n+1)(4n)(n+1)=(2n+1)(4)(2k)=8k(2n+1)$

where $n(n+1)$ is product of two consecutive integers, one of which has to be even, and hence $n(n+1)$ has to be even. It can be written as $2k$ where $k$ is an integer

$a(a^2-1)$ is therefore divisible by 8.

Also $a(a^2-1)=(a-1)(a)(a+1)$ is divisible by 3 as one of three consecutive integers has to be divisible by 3.

Therefore, $a(a^2-1)$ is divisible by 24


You have already shown that $8$ is a factor, so you just need to show that $3$ is also a factor of the number. This can be done in a similar way. If $a$ is divisible by $3$, then clearly so is $a(a^2-1)$. Otherwise $a=3k\pm1$ for some $k$. But then $a^2-1 = 9k^2\pm 6k = 3(3k^2\pm 2k)$ which is divisible by $3$.


Edit Marius gives an alternative way to see the divisibility by $3$ in the comments. It should potentially also explicitly be stated that that we can consider the divisibility by $3$ and by $8$ separately because $3$ and $8$ are relatively prime.