Let $p$ be an odd prime and $\zeta \not = 1$ be a $p^{th}$ root of unity. Let $R$ denote the set of all quadratic residues in $\mathbb{F}_p^*$.
If $\alpha=\sum_{r\in R} \zeta^r$, prove that
$$\alpha (-1-\alpha)=\begin{cases} -\frac{p-1}{4} &,\;\;\mbox{if }\;\; p\equiv 1 \\{}\\\;\;\; \frac{p+1}{4} &,\;\;\mbox{if }\;\; p\equiv 3. \end{cases} \pmod 4$$
I think this is quite famous. Can anyone give me a clue how to go about it?
Let $R$ denote the quadratic residues(nonzero), and $N$ be the nonresidues.
Consider the sum: $$ G=\sum_{n=1}^{p-1}\left(\frac{n}{p}\right)\zeta^n=\sum_{n\in R} \zeta^n-\sum_{n\in N} \zeta^n=1+2\sum_{n\in R} \zeta^n$$
This can be written as $$ G=\sum_{n=0}^{p-1}\zeta^{n^2}.$$
For the evaluation of this, see my answer to A Trigonometric Sum Related to Gauss Sums
$$ G(m)=\sum_{n\textrm{ (mod $m$)}} e\left(\frac{n^2}{m}\right)=\frac{1+i^{-m}}{1+i^{-1}}\sqrt{m}. $$
This is a special case when $m$ is an odd prime.