I'm currently working in the following Wilson's theorem excercise:
Being $p$ an odd prime. Let $x=((p-1)/2)!$
Using the fact that $(p − 1)! = (1(p − 1)) (2(p − 2)) · · · (((p − 1)/2)((p + 1)/2))$ show that: $$-1 \equiv (-1)^{(p-1)/2}x^2 \pmod p$$
I'm starting from:
$$(1(p − 1)) (2(p − 2)) · · · (((p − 1)/2)((p + 1)/2))\equiv -1 \pmod p$$
My plan is to simplify terms on the left side to reach that $(p-1)/2$ which is the power of that $-1$, but I really don't know how can it be raised to that power, any hint or help will be really appreciated.