Let $a, b\in\mathbb{Z}$, $n\in\mathbb{N}$, and $k, \ell\in \mathbb{N}$, such that $k\equiv \ell \mod{n}$ and $a\equiv b\mod n$.
Is it true that $a^k\equiv a^\ell \mod n$? If so, prove it. If not, find a counterexample.
I suppose it's true, but I'm not sure how to prove it.
Hint: What if $n=3$, $k=1$, $\ell=4$ and $a=2$?