Let $p$ be a prime of the form $3k+2$ that divides $a^2+ab+b^2$ for some integers $a,b$. Prove that $a,b$ are both divisible by $p$. Let $p$ be a prime of the form $3k+2$ that divides $a^2+ab+b^2$ for some integers $a,b$. Prove that $a,b$ are both divisible by $p$.  
My attempt:
$p\mid a^2+ab+b^2 \implies p\mid (a-b)(a^2+ab+b^2)\implies p\mid a^3-b^3$
So, we have, $a^{3k}\equiv b^{3k}\mod p$ and by Fermat's Theorem we have, $a^{3k+1}\equiv b^{3k+1}\mod p$ as $p$ is of the form $p=3k+2$.  
I do not know what to do next. Please help. Thank you.
 A: Suppose that $p=3k+2$ is prime and 
$$
\left.p\ \middle|\ a^2+ab+b^2\right.\tag1
$$
then, because $a^3-b^2=(a-b)\left(a^2+ab+b^2\right)$, we have
$$
\left.p\ \middle|\ a^3-b^3\right.\tag2
$$
Case $\boldsymbol{p\nmid a}$
Suppose that $p\nmid a$, then $(2)$ says $p\nmid b$. Furthermore,
$$
\begin{align}
a^3&\equiv b^3&\pmod{p}\tag3\\
a^{3k}&\equiv b^{3k}&\pmod{p}\tag4\\
a^{p-2}&\equiv b^{p-2}&\pmod{p}\tag5\\
a^{-1}&\equiv b^{-1}&\pmod{p}\tag6\\
a&\equiv b&\pmod{p}\tag7\\
\end{align}
$$
Explanation
$(3)$: $\left.p\ \middle|\ a^3-b^3\right.$
$(4)$: modular arithmetic
$(5)$: $3k=p-2$
$(6)$: if $p\nmid x$, then $x^{p-2}\equiv x^{-1}\pmod{p}$
$(7)$: modular arithmetic
Then, because of $(1)$ and $(7)$,
$$
\begin{align}
0
&\equiv a^2+ab+b^2&\pmod{p}\\
&\equiv 3a^2&\pmod{p}\tag8
\end{align}
$$
which, because $p\nmid 3$, implies that $p\mid a$, which contradicts $p\nmid a$ and leaves us with
Case $\boldsymbol{p\mid a}$
If $p\mid a$, then $(2)$ says $p\mid b$ and we get
$$
\left.p^2\ \middle|\ a^2+ab+b^2\right.\tag9
$$
A: Use quadratic reciprocity.
$$4(a^2+ab+b^2)=(2a+b)^2+3b^2$$
so if 
$$a^2+ab+b^2\equiv 0 \pmod p$$ then 
$$(2a+b)^2\equiv -3b^2 \pmod p$$ and $-3$ is a quadratic residue so
$$\left(\frac{-3}{p}\right)=1.$$
However by reciprocity,
$$\left(\frac{-3}{p}\right)=\left(\frac{p}{-3}\right)=\left(\frac{2}{3}\right)=-1$$
A: You have shown that $a^3 \equiv b^3 \pmod p$. Remark that $(3, p-1)=1$ because $p=3k+2$. Thus we can write $3m + (p-1)n = 1$ for some integers $m, n$. Use this to show that $a\equiv b \pmod p$, so that $a^2+ab+b^2 \equiv 3a^2 \equiv 3b^2 \equiv 0 \pmod p$, and conclude from there. 
(P.S. I have to commend you for posting your work!)
A: By lil' Fermat, $a^{3k+1}\cong b^{3k+1}\bmod p\implies a\cdot
b^{3k}\cong b\cdot b^{3k}\bmod p$.  Thus $\begin{align} a\cong b\bmod p\implies a=b+pk \implies a^2+ab+b^2=(b+pk)^2+(b+pk)b+b^2=3b^2+3bpk+p^2k^2\end{align}$.  But this expression is divisible by $p$.  So $3b^2=-3bpk-p^2k^2+pl\implies p|3b^2\implies p|b\implies p|a$. 
