Problem:Let $p$ be a prime of the form $3k+2$ that divides $a^2+ab+b^2$ for some $a,b\in \mathbb{Z}$. Prove that $a,b$ are both divisible by $p$.
My Attempt: $a^2+ab+b^2\equiv 0 \pmod p\Rightarrow a^3\equiv b^3\pmod p\Rightarrow a^{3k}\equiv b^{3k}\pmod p.$
Next, observe that due to FLT we have $a^{3k+1}\equiv b^{3k+1}\pmod p.$ Now if $p\not|a$ and $p\not|b$, then $\gcd(a,p)=\gcd(b,p)=1.$ Therefore we can use can conclude that $$a^{\gcd(3k,3k+1)}\equiv b^{\gcd(3k,3k+1)}\pmod p\Rightarrow a\equiv b\pmod p.$$ Therefore $$a^2+ab+b^2\equiv 0 \pmod p\Rightarrow 3b^2\equiv 0\pmod p \text{ and } 3a^2\equiv 0\pmod p.$$ Which implies that $p|3$ which is a contradiction. Hence Proved.
I would like to know whether this proof is correct or not. I am unsure about the use of $\gcd$ in the exponent. Moreover, I acknowledge that this question has been asked before, but I've not seen any answer using this fact explicitly. The fact being: Let $\gcd(a,m)=\gcd(b,m)=1$, then if $a^{x}\equiv b^x\pmod m$ and $a^y\equiv b^y\pmod m\Rightarrow a^{\gcd(x,y)}\equiv b^{\gcd(x,y)}\pmod m.$