The sum of the cubes of three consecutive integers is divisible by $9$

The classes mod $9$ of the cubes of $0, \ldots, 8$ are $$0, \, 1, \, -1, \, 0, \, 1, \, -1, \, 0, \, 1, \, -1.$$ The sum of any three consecutive of them is clearly $0$.


Yes, your way is correct. An alternative method (which I leave you to determine whether it is more elegant or not):

$$(n+1)^3 +n^3 +(n-1)^3 = 3n(n^2+2) = 3n(n^2-1+3)\\=3n((n-1)(n+1)+3)=3(n-1)n(n+1)+9n$$

Of the consecutive numbers $(n-1), n, (n+1)$ one is divisible by $3$, which leaves that the term is divisible by 9.


You can observe that $$n(n^2+2)\equiv n(n^2+3n+2)\equiv n(n+1)(n+2) \bmod 3$$ and that the product of three successive integers is divisible by $3$