Prove that $x^3 \equiv a \pmod{p}$ has a solution where $p \equiv 2 \pmod{3}$?

Hint $\:$ Show $ \: x\to x^3\: $ is a bijection via $\rm\color{#c00}{little\ Fermat}$ and $\, \overbrace{3 (2K\!+\!1) = 1 + 2(3K\!+\!1)}^{\textstyle 3J\ \equiv\ 1\ \pmod{p-1}}$

In detail: $ \ \ x^{3J} =(x^{\color{#0a0}{2K+1}})^{\large 3}=\ x (\color{#c00}{x^{3K+1}})^{\large 2} \equiv x\pmod{\!p}\ \ $ for $ \ x\not\equiv 0,\, $ prime $\,p = 3K\!+\!2$.

Thus $ \ x\to x^3\ $ is onto on the finite set $ \:\mathbb Z/p\:,\:$ so it is also $\,1$-$1,\,$ i.e. $ \ x^3 \equiv y^3\, \Rightarrow\, x\equiv y$.

Note: this answers the original version of your question (existence and uniqueness of cube roots).

Remark $ $ the exponent $\,J = \color{#0a0}{2K\!+\!1}$ with $\,x^{3J}\equiv x^{\large 1}\pmod{p=3K\!+\!2}\,$ was computed via

$\!\bmod p\!-\!1=3K\!+\!1\!:\ \ 3J\equiv 1\iff J\equiv \dfrac{1}{3}\equiv \dfrac{-3K}3\equiv -K\equiv \color{#0a0}{2K+1}$

using modular order reduction and $\bmod p\!:\ x^{\large p-1}\equiv 1,\ x\not\equiv 0,\,$ by little Fermat.


For reference, check out Ireland and Rosen's A Classical Introduction to Modern Number Theory, which will allow you a first taste on a bunch of topics in number theory (though the authors assume basic familiarity with abstract algebra). What's nice about your question is that it admits several methods of proof.

Notice that your hypothesis on $p$ is unnecessary if $a \equiv 0 \pmod{p}$ (simply use $x=0$). So assume $a \not\equiv 0 \pmod{p}$. In that case, Ch.4 of Ireland and Rosen tells us that (1) $a^{p-1} \equiv 1 \pmod{p}$ and (2) $x^3 \equiv a \pmod{p}$ is solvable if and only if $$a^{(p-1)/\gcd(p-1, 3)} \equiv 1 \pmod{p}.$$ But guess what: since $p-1 \equiv 1 \pmod{3}$ by hypothesis, congruence theory says $$\gcd(p-1, 3) = \gcd(1, 3) = 1.$$ Thus by (1), $$a^{(p-1)/\gcd(p-1, 3)} = a^{p-1} \equiv 1 \pmod{p},$$ and so we're done!


My intuition tells me to attempt a proof by contradiction via factoring: Assume $x^3 \equiv y^3 \equiv a \pmod p$ thus $(x-y)(x^2+xy+y^2) = x^3-y^3 \equiv 0$. Since $\mathbb{Z}_p$ is an integral domain and we are assuming $x$ and $y$ are distinct (as elements of $\mathbb{Z}_p$, we must have $x^2+xy+y^2 \equiv 0$, thus $x^2+xy+y^2 = n(3k+2)$ for some $n$. If $n$ is even we have that every term is even, which allows us to factor out $2$ from $x$ and $y$. We can assume this is true since if $x$ is an odd solution, $x+3k+2$ is an even solution as operations on $\mathbb{Z}_p$ are well-defined, and similarly for $y$. Thus we have $x/2$ or $(x+3k+2)/2$ and $y/2$ or $(y+3k+2)/2$ are solutions. You should be able to derive a contradiction from there.