If $p$ is prime and $p\equiv1$(mod $4$), then $x^2 \equiv -1$ (mod $p$) has two incongruent solutions given by $x\equiv\pm(\frac{p-1}{2})!$(mod $p$).
I saw this question on this site earlier but the solutions that the guy chose didn't really help me figure this out much. It doesn't help that I have no clue what $x\equiv\pm(\frac{p-1}{2})!$(mod $p$) implies.
Hint: Using Wilson's theorem,
$$\prod_{n=1}^{p-1} n \equiv -1 \bmod p.$$
Now split it up into
$$\left(\prod_{n=1}^{(p-1)/2} n\right)\left(\prod_{n=(p+1)/2}^{(p-1)} n\right)\equiv -1\bmod p.$$
Can you see how to transform the second product to show that $x^2\equiv -1\bmod p$ if $x\equiv\pm \left(\frac{p-1}{2}\right)!$?