I'm asked to prove that if $\gcd(n,p-1)=1$ where p is prime, then $$x^n\equiv a \pmod{p}$$ has exactly one solution. What I've done so far is the following,
Since $\gcd(n,p-1)=1$, that means, except for $1$, there is no least residue $r$ such that $r^n\equiv 1\pmod{p}$. Moreover, it would suffice to show that every least residue raised to $n$ is cogruent to another unique least residue or, in other words, for any two least residues $a,b$, $$a^n\equiv b^n\pmod{p}\quad\to\quad a\equiv b\pmod{p}.$$ To do so, suppose $a^n\equiv b^n\pmod{p}$, then $$p\mid (a-b)(a^{n-1}+a^{n-2}b+\dots + b^{n-2}a+ b^{n-1})$$ and so $p$ must divide one of those terms. At this point, I tried to show that $p\nmid (a^{n-1}+a^{n-2}b+\dots + b^{n-2}a+ b^{n-1})$ by finding a contradiction but I got stuck. I'm thinking maybe one of my earlier steps was incorrect because I'm not really using the fact that $\gcd(n,p-1)=1$ in the proof. Am I heading in the right direction here ?
If $a\equiv0$, then $a\equiv 0^n$.
If $a\not\equiv0 $, then $\gcd(a,p)=1$. Since $\gcd(n,p-1)=1$, we have $nu=1+(p-1)v$, for some $u,v \in \mathbb N$. Then $(a^u)^n = a^{nu} = a^{1+(p-1)v} = a (a^{p-1})^v \equiv a$.
Therefore, the map $x \mapsto x^n$ on $\Bbb Z/(p)$ is surjective and so it must be injective. In other words, there is exactly one solution of $x^n \equiv a \bmod p$.