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.Prove that if is an odd prime then has solutions if and only if or .

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.