Let $p$ be an odd prime. Prove that Legendre Symbol $\left(\frac{(p-1)!}p\right)=1$ if $p\equiv1\pmod4$, $-1$ if $p\equiv3\pmod4$.
Not sure where to begin but here are my initial thoughts.
Clearly, the only way $p$ can be an odd prime is if $p\equiv1$ or $3\pmod4$. Then I see that by Legendre Symbol properties:
$\left(\frac{(p-1)!}p\right) = \left(\frac1p\right)\cdot\left(\frac1p\right)\cdots \left(\frac{p-1}p\right)$, and this is an even number of Legendre symbols. Then by Euler's Criterion, since $p$ is an odd prime, and obviously none of $a = 1, 2, 3, \ldots, p-1$ are divisible by $p$, then $\left(\frac ap\right) \equiv a^{(p-1)/2}\pmod p$.
Not sure if this is the right path, or if I am missing something.
I made an edit to what I have so far:
Clearly, the only way $p$ can be an odd prime is if $p\equiv1\pmod4$ or $p\equiv3\pmod4$. Then, by Wilson’s Theorem we see that $\left(\frac{(p-1)!}p\right)\equiv\left(\frac{-1}p\right)\equiv\left(\frac{p-1}p\right)\pmod p$. Then, we know that from previous work, a square can be of the form $4k$, or $4k + 1$, but not $4k + 2$, or $4k + 3$. Then we see that... (not sure how to finish this off).