# If $a,b$ are not divisible by prime $p,$ prove that $(a^p \equiv b^p \pmod p)\rightarrow (a\equiv b \pmod p)$

If $a$ and $b$ are not divisible by prime $p$, prove that if $a^p \equiv b^p \pmod p$, then $a \equiv b \pmod p$

I know the answer is related to Fermat's Little Theorem. If $a^{p-1} \equiv 1 \pmod p$, then $a^p \equiv a \pmod p$, but I'm not sure how to apply that to both $a$ and $b$ in the original question.

Just apply Fermat's little theorem twice: $$a\equiv a^p\equiv b^p\equiv b\mod p$$ The two "outer" equivalences are Fermat's little theorem. By the way, this argument still works if $a$ and $b$ are divisible by $p$.