Proof on cubic residues This problem is from "An Introduction to Number Theory" by Ivan Niven.
Define a to be a cubic residue if $x^3 \equiv a \mod p$ has solutions. Prove that if $p=3k+2 ,$ then every number that is in reduced residue system is a cubic residue. And if $p=3k+1$, only one-third of the reduced residues are cubic residues.I did find a solution here. But, I've not covered the portion in the book after section 2.5(self-study). I attempted the question in the following way and would appreciate any hints to reach to conclusion: 
As $B=\{1,2,\dots ,p-1\}$ is a reduced residue system, it should be enough to prove that $i^3 \equiv j^3\mod p \Rightarrow i\equiv j\mod p$. So, one part of it boils down to 
If $p=3k+2$, then show that $p \nmid i^2+j^2+ij $, if $i\neq j \wedge i,j \in B$. I have no idea how to use the $p=3k+2$ part for proving this.

Hint $\ $ The map $\ x\,\mapsto\, x^{\large 3}\ $ has inverse $\ x\,\mapsto\, x^{\large\color{#c00}{ 1+2k}} \ [\,\equiv x^{\large\color{#c00}{1/3}}\,]\ $ since by $\rm\color{#0a0}{Fermat}$
$$(x^{\large 3})^{\large\color{#c00}{ 1+2k}}\equiv x^{\large 1+2(1+3k)}\equiv x^{\large 1+2(p-1)}\equiv x (\color{#0a0}{x^{\large p-1}})^{\large 2}\equiv x\, \color{#0a0}{\bf 1}^{\large 2}\equiv x $$
Remark $\ $ More conceptually it's true because $\, \color{#c00}{1\!+\!2k\equiv 1/3}\ $ exists $\!\!\mod{p\!-\!1}\ $ since
$${\rm mod}\,\ p\!-\!1 = 1\!+\!3k:\ \  1\!+\!2k \equiv -k\equiv \dfrac{1}3\ \ \ {\rm by}\ \ \ 3(-k)\equiv 1\qquad $$
So raise $\ x^{\large 3}\equiv a\ $ to power $\, 1/3\equiv 1\!+\!2k\pmod{p\!-\!1}\ $ to get $\, x\equiv a^{\large 1+2k}$
Note $\ $ It suffices to know that $\,1/3\,$ exists mod $\,p\!-\!1,\,$ or equivalently, by Bezout, that $\,\gcd(3,p\!-\!1) = 1.\,$ We do not need to explicitly compute the inverse as we did above.
