Solution (source code)

= Solution

Inversion permutes the nonzero residues excluding $-1$. Hence the result of part (c) changes the requested sum into
$$
\sum_{n=1}^{p-2}\left(\frac{n(n+1)}p\right)=\sum_{m=1}^{p-2}\left(\frac{m+1}p\right)=\sum_{j=2}^{p-1}\left(\frac jp\right).
$$
There are exactly $(p-1)/2$ nonzero squares: the map $x\mapsto x^2$ on nonzero residues identifies exactly the pairs $x,-x$, because $x^2=y^2$ implies $x=\pm y$ in the <finite field>. Thus there are equally many nonzero squares and nonsquares, and the <complete Legendre-symbol sum> is zero. Removing the $j=1$ term leaves
$$
\boxed{\sum_{n=1}^{p-2}\left(\frac{n(n+1)}p\right)=-1.}
$$