<s>[INST] For prime $p>2: 1^23^25^2\cdot\cdot\cdot(p-2)^2 \equiv (-1)^{\frac{p+1}{2}} \pmod p$ 
Possible Duplicate:
Why is the square of all odds less than an odd prime $p$ congruent to $(-1)^{(p+1)/(2)}\pmod p$?
If p is an odd prime, prove that $1^2 \times 3^2 \times 5^2 \cdots  \times (p-2)^2 \equiv (-1)^{(p+1)/2}\pmod{p}$  

I'd love your help with proving the following claim:
For prime $p>2$:
$$1^23^25^2\cdot\cdot\cdot(p-2)^2 \equiv (-1)^{\frac{p+1}{2}} \pmod p.$$
I instantly thought of Wilson Theorem which says that $1\cdot2\cdot3\cdot\cdot\cdot\cdot(p-1) \equiv (-1) \pmod p$, but I can't see how to use it.
I also tried to divide it to two cases, for $p \equiv 1 \pmod4$, and $p \equiv 3 \pmod4$, but again I didn't reach the conclusion.
Thanks a lot!
 [/INST] Since $p$ is odd, the negatives of the odd residues listed in your product are the even residues: $-1=p-1\pmod{p}$, $-3=p-3\pmod{p}$, $-5=p-5\pmod{p}$, etc.
By Wilson's Theorem, the product of all of these non-zero residues is $(p-1)!=-1\pmod{p}$.
Your product can be changed to $(p-1)!$ by
$$
\begin{align}
\color{#C00000}{1^2}\cdot\color{#00A000}{3^2}\cdot\color{#0000FF}{5^2}\cdots(p-2)^2
&=(-1)^{\frac{p-1}{2}}\color{#C00000}{1\cdot(p-1)}\cdot\color{#00A000}{3\cdot(p-3)}\cdot\color{#0000FF}{5\cdot(p-5)}\cdots(p-2)\cdot2\\
&=(-1)^{\frac{p-1}{2}}(-1)\\
&=(-1)^{\frac{p+1}{2}}\pmod{p}
\end{align}
$$
</s>