For primes $p≡3\pmod 4$, prove that $!≡±1\pmod p$.

I know to use Wilson’s Theorem and that each element in the second half is congruent to the negative of the first half, but I’m not sure how to construct a proof for it.

Solutions Collecting From Web of "For primes $p≡3\pmod 4$, prove that $!≡±1\pmod p$."

$p-r\equiv -r\pmod p\implies r\equiv-(p-r)$

For uniqueness, $r\le p-r$ or $2r\le p\implies r\le\frac p 2$

So, $1\le r\le \frac{p-1}2$ as $p$ is odd

Putting $r=1,2,3,\cdots,\frac{p-3}2,\frac{p-1}2$ we get,

$1\equiv-(p-1)$

$2\equiv-(p-2)$

$\frac{p-3}2\equiv-(p-\frac{p-3}2)=\frac{p+3}2$

$\frac{p-1}2\equiv-(p-\frac{p-1}2)=\frac{p+1}2$

So, there are $\frac{p-1}2$ pairs so,

$(p-1)!=(-1)^{\frac{p-1}2}\left((\frac{p-1}2)!\right)^2$

Using Wilson’s theorem, $(-1)^{\frac{p-1}2}\left((\frac{p-1}2)!\right)^2\equiv-1\pmod p$

If $p\equiv3\pmod 4,p=4t+3$ for some integer $t$,

So, $\frac{p-1}2=2t+1$ which is odd, so $(-1)^{\frac{p-1}2}=-1$

$\implies \left((\frac{p-1}2)!\right)^2\equiv1\pmod p$

$\implies \left(\frac{p-1}2 \right)!\equiv\pm1\pmod p$