Prove that if $\displaystyle p$ is an odd prime then $\displaystyle x^2\equiv 2\mod p$ has solutions if and only if $\displaystyle p\equiv1$ or $\displaystyle 7\mod 8$.
This exercise comes in the chapter on quadratic residues and the Legendre symbol. I have absolutely no idea how to prove what it asks. None of the theorems in the chapter seem relevant.

My professor has been skipping around in the book, and blending in his own material. I suspect he may have skipped over something from an earlier chapter, which I need to solve this.

Hints or useful theorems would be much appreciated.

2. The easiest way to prove this is probably by using Gauss's lemma.

Let me know if you need help.

3. ## Legendre symbol result

If you already have Legendre symbol results, one of them is
$\displaystyle (2/p) = (-1) ^ { (p^2-1) / 8 }$
If p=1(8), then p = 8k+1, so $\displaystyle p^2 = 64k^2 + 16k + 1$
and
$\displaystyle (p^2-1)/8 = (64k^2 + 16k) /8 = 8k^2 + 2k$
is even. So the Legendre symbol is 1 and 2 is a quadratic residue.
Try the remaining cases: p=3(8), p=5(8) and p=7(8).