Can anyone help me explain why if $x$ is an integer, then $(x^3+1)\bmod 3 = (x+1)^3 \bmod 3$? I know there are 3 cases. $x=0\bmod3,\ x=1\bmod3,$ and $x=2\bmod3$ totally new to this form of mathematics, could anyone help me setup the proof?
If you're allowed to use it, by Fermat's Little Theorem $n^3\equiv n\pmod3$. Using this gives
$$x^3+1\equiv(x+1)^3\equiv x+1\pmod 3$$
hint: $3x^2 = 0\pmod 3, 3x = 0 \pmod 3$
$(x+1)^3 -(x^3+1) = 3(x+x^2)$.