If $p\equiv 2$ mod $3$, $x^{3}\equiv a$ mod $p$ has only one solution modulo $p$. Let $p$ be an odd prime and $a\in \mathbb{Z}$ such that $p\nmid a$. I have to show that if $p\equiv 2$ mod $3$, then $x^{3}\equiv a$ mod $p$ has only one solution modulo $p$. Using the properties of the cubic symbol it is easy to check that there is a solution $\alpha$. The problem is that I do not know how to prove that, if there is another $\beta\in \mathbb{Z}$ such that $\beta^{3}\equiv a$ mod $p$, then $\beta\equiv\alpha$ mod $p$.
It must be easy, but I do not get to find a prove.

For any $x$ between $1$ and $p-1$, let $f(x)$ be the remainder when $x^3$ is divided by $p$/
We show that the function $f(x)$ is one to one. It  will follow that $f(x)$ is onto. That implies that for any $\alpha$ between $1$ and $p-1$ there is a $\beta$ such that $\beta^3\equiv \alpha\pmod{p}$.  
To show $f$ is one to one, we show that if $x^3\equiv y^3\pmod{p}$, then $x\equiv y\pmod{p}$.  Equivalently, we need to show that if $z^3\equiv 1\pmod{p}$ then $z\equiv 1\pmod{p}$.
This is easy. Since $z^3\equiv 1\pmod{p}$, the order of $z$ must divide $3$. We show it cannot be $3$ so must be $1$.  The order of $z$ modulo $p$ divides $p-1$.  But if $p\equiv 2\pmod{3}$ then $3$ cannot divide $p-1$. 
