<s>[INST] Another Congruence Proof I've been asked to attempt a proof of the following congruence.  It is found in a section of my textbook with Wilson's theorem and Fermat's Little theorem.  I've pondered the problem for a while and nothing interesting has occurred to me.
$1^23^2\cdot\cdot\cdot(p-4)^2(p-2)^2\equiv (-1)^{(p+1)/2} (\text{mod} p)$
 [/INST] An idea that, perhaps, will appeal to you besides the ones already given above:$$1^23^2\cdot\ldots\cdot (p-1)^2=\frac{\left(1\cdot 2\cdot\ldots\cdot (p-1)\right)^2}{\left(2\cdot 4\cdot\ldots\cdot (p-1)\right)^2}\,\,(**)$$Now we use Wilson's theorem, Fermat's Little Theorem and arithmetic modulo $p$: $$(**)\,\,=\frac{(-1)^2}{\left(2^{\frac{p-1}{2}}\right)^2\left(1\cdot 2\cdot\ldots\cdot\frac{p-1}{2}\right)^2}=\frac{1}{1\cdot\left(1\cdot 2\cdot\ldots\cdot\frac{p-1}{2}\right)^2} \,\,\,(***)$$
Let us now check more closely Wilson's theorem (again, arithmetic modulo $p$):$$-1=1\cdot 2\cdot\ldots\cdot\frac{p-1}{2}\cdot\frac{p+1}{2}\cdot\ldots\cdot (p-1)=$$$$=1\cdot 2\cdot\ldots\cdot\frac{p-1}{2}\left(-\frac{p-1}{2}\right)\cdot\ldots\cdots (-2)(-1)=$$$$=\left(-1\right)^{\frac{p-1}{2}}\left(1\cdot 2\cdot\ldots\cdot\frac{p-1}{2}\right)^2$$So: $$(1)\,\,p=3\pmod 4\Longrightarrow \frac{p-1}{2}\text{ is odd}\Longrightarrow (-1)^\frac{p-1}{2}=-1\Longrightarrow $$$$\Longrightarrow\,\,(***)=1$$$$(2)\,\,p=1\pmod 4\Longrightarrow \frac{p-1}{2}\text {is even}\,\Longrightarrow (-1)^{\frac{p-1}{2}}=1\Longrightarrow$$$$\Longrightarrow (***) =-1$$
</s>