<s>[INST] Prove that $\sum_{t=1}^{p-1} \frac{t^2-1}{t^2+1} \equiv 0 \pmod p$ I'm trying to prove the statement $\sum_{t=1}^{p-1} \frac{t^2-1}{t^2+1} \equiv 0 \mod p$ and I don't really know where to start. Obviously $\sum_{t=1}^{p-1} \frac{t^2-1}{t^2+1} = 2\sum_{t=1}^{(p-1)/2} \frac{t^2-1}{t^2+1}$ since $(-t)^2 = t^2$, but I'm not sure if this is helpful in any way. If anyone would be able to give me a hint on where to begin it would be very much appreciated.
 [/INST] Key idea: find a polynomial in $\Bbb Z/p\Bbb Z$ whose roots are precisely $\frac{t^2-1}{t^2+1}$. (I assume $p\equiv3\pmod4$.)
Note that if $x=\frac{t^2-1}{t^2+1}=1-\frac2{t^2+1}$ then $t^2=\frac2{1-x}-1=\frac{1+x}{1-x}$, so we have (if $t\neq0$)
$$\left(\frac{1+x}{1-x}\right)^{\frac{p-1}2}=1.$$
For $t\neq0$, $t^2$ takes exactly $\frac{p-1}2$ different values, hence so does $1-\frac2{t^2+1}$. This means that the roots of $\left(\frac{1+x}{1-x}\right)^{\frac{p-1}2}=1$ are precisely the values $\frac{t^2-1}{t^2+1}$, each occurring exactly once.
The coefficient of $x^{\frac{p-1}2-1}$ in $(1+x)^{\frac{p-1}2}-(1-x)^{\frac{p-1}2}$ is $0$, hence so is the sum of its roots.
</s>