I need to describe all odd primes $p$ for which $7$ is a quadratic residue.
Now let $\left(\frac{a}{b}\right)$ be the Legendre Symbol.
Then if $7$ is a quadratic residue $p$ we must have: $$1=\left(\frac{7}{p}\right)=(-1)^{\frac{3(p-1)}{2}} \left(\frac{p}{7}\right)$$ Here I have used Gauss theorem on Quadratic Reciprocity.
This implies that $\left(\frac{p}{7}\right)=1$ and $(-1)^{\frac{3(p-1)}{2}} = 1$, or $\left(\frac{p}{7}\right)=-1$ and $(-1)^{\frac{3(p-1)}{2}} = -1$.
HOWEVER at this step in the solutions, we are given that:
$\left(\frac{p}{7}\right)=1$ and $p\equiv 1\bmod 4$
OR $\left(\frac{p}{7}\right)=-1$ and $p\equiv -1\bmod 4$
Why is this equivalent? So what I am basically asking is the following:
Why is $(-1)^{\frac{3(p-1)}{2}} = 1$ equivalent to $p\equiv 1\bmod 4$?
And $(-1)^{\frac{3(p-1)}{2}} = -1$ equivalent to $p\equiv -1\bmod 4$?