Uniqueness of $n$'th roots $\bmod p\,$ when $n$ is coprime to $p-1$ Prove, that if $n$ is coprime to $p - 1$ ($p$ is prime), then exponentiation to the $n$th power in the residue field modulo $p$ is a bijection.
I tried proving that $a^n \equiv b^n \pmod{p} \Rightarrow a = b$, but I couldn't.
Also I have to prove that for each $i = 0,\dots,p-1$, there exists $x$ such that $x^n \equiv i \pmod{p}$.
 A: If $n$ is coprime to $p-1$, then there exists $k$ such that $nk\equiv 1\pmod{p-1}$, so, for some $t$, $nk+(p-1)t=1$.
You also know that $x^{p-1}=1$, for every $x\in\mathbb{F}_p$ (the $p$-element field), provided $x\ne0$.
Then, for $x\ne0$,
$$
x^{nk}=x^{nk}(x^{(p-1)})^t=x^{nk+(p-1)t}=x^1=x
$$
Obviously, $0^{nk}=0$.
Therefore the map $x\mapsto x^k$ is the inverse of $x\mapsto x^n$.
A: Hint: $ $ By little Fermat $\,\color{#d0f}{a^{p-1}} \equiv 1\equiv \color{#d0f}{b^{p-1}}\pmod{\!p}\,$ so $\,n\,$ coprime to their periods $\,\color{#d0f}{f=p\!-\!1}$ implies that $\,a^n\,$ and $\,b^n\,$ have unique $\,n'$th roots $\!\bmod p\,$ by the following
Theorem $\, $ [Compute $n$'th root by raising to power $\frac{1}n\!\pmod{\!f}\,$ if $\,n\,$ is coprime to $\color{#d0f}{{\rm period}\ f}$]
Given $\ \color{#d0f}{a^f} \equiv 1\equiv \color{#d0f}{c^f}\pmod{\!m},\, $  and $\  n' \equiv \frac{1}n\equiv n^{-1}\pmod{\!f},\, $ so  $\ \color{#0a0}{nn' = 1 + jf},\ $ then
$$ \bbox[5px,border:1px solid #c00]{a^{\large\color{#c00} n} \equiv  c \iff a \equiv c^{\large (\color{#c00}{1/n})_f}\equiv c^{\large n'}\!\!\!\pmod{\!m}}\qquad$$
$\begin{align}{\bf Proof}\ \ \ \  &c \equiv a^{\large n}\,\Rightarrow\, c^{\large n'}\! \equiv a^{\large\color{#0a0}{nn'}}\! \equiv a^{\large\color{#0a0}{1+fj}} \equiv a(\color{#d0f}{a^{\large f}})^{\large j} \equiv a\\[.1em]
&a \equiv c^{\large n'}\!\Rightarrow\, a^{\large n} \equiv c^{\large\color{#0a0}{n'n}} \equiv \,c^{\large\color{#0a0}{1+fj}} \equiv \,c(\color{#d0f}{c^{\large f}})^{\large j} \equiv c \end{align}$
