Not having a background in abstract algebra is a huge handicap in this kind of problems: how come?! Anyway:

Putting : the hint (a rather big one) together with the conditions on the prime p tell you that , and from here

it follows that ...try to take it from here, taking into account that there exist exactly quadratic residues modulo p, counting zero of course.

Tonio