<s>[INST] Show equivalence with Legendre symbol Let $p,q$ be two odd primes for which $p=2q+3$. I want to show that $\left( \frac{q}{p}\right)=1 \iff q=\pm 1 \pmod{12}$.
I have thought the following.
$$\left( \frac{q}{p}\right)=\left( \frac{p}{q}\right) (-1)^{\frac{p-1}{2} \cdot \frac{q-1}{2}}=\left( \frac{p}{q}\right) (-1)^{\frac{(q+1)(q-1)}{2} }=\left( \frac{p}{q}\right)$$
So we know that if there is a $x$ such that $x^2 \equiv q \pmod{p}$, then there is also a $y$ such that $y^2 \equiv p \mod{q}$.
But how can we get the desired equality for $q$ ?  
 [/INST] Assume $(\frac{q}{p}) = 1.$ Then we have $(\frac{p}{q}) = (-1)^{\frac{(q + 1)(q - 1)}{2}} = 1.$ Note that $q \equiv 1, 5, 7, 11 \pmod{12}.$ ($q \neq 3$ because then $p = 9$) We have $(\frac{p}{q}) = (\frac{3}{q}) = 1$ implies that $(\frac{q}{3}) = (-1)^{\frac{q - 1}{2}}.$ So if $q \equiv 5 \pmod{12}, (\frac{q}{3}) = (\frac{2}{3}) = -1 = (-1)^{2 + 6k} = 1.$ Contradiction. If $q \equiv 7 \pmod{12}$ then $(\frac{1}{3}) = 1 = (-1)^{3 + 6k} = -1.$ Contradiction. 
To show the reverse direction, we want to show that $(\frac{q}{p}) = (\frac{p}{q}) = 1.$ Thus, we want to show that $(\frac{p}{q}) = (\frac{3}{q}) = 1.$ We have that $(\frac{3}{q})(\frac{q}{3}) = (-1)^{\frac{q - 1}{2}}.$ If $q \equiv 1 \pmod{12}$ then $(\frac{q}{3}) = 1.$ And thus, $(\frac{3}{q}) = (-1)^{6k} = 1.$ If $q \equiv -1 \pmod{12}$ then $(\frac{q}{3}) = -1$ and $-(\frac{3}{q}) = (-1)^{-1 + 6k} = -1.$ Thus, $(\frac{p}{q}) = 1 = (\frac{q}{p}).$
</s>