# Why is $\sum_{x=1}^{p-1}\left(\frac{x}{p}\right)=\left(\frac{0}{p}\right)$?

For $p$ an odd prime, why does $$\sum_{x=1}^{p-1}\left(\frac{x}{p}\right)=\left(\frac{0}{p}\right)$$

where $\left(\frac{x}{p}\right)$ is the Legendre symbol.

I'm not sure if I have given enough context for this to necessarily be true, but I read it in lecture notes and can't understand why it is true.

this equation is merely a slightly awkward way of saying that exactly half of the numbers $1,2,\cdots,p-1$ are quadratic residues $\mod p$