<s>[INST] How can I prove that $ (3/p) = -1$ if $ p \equiv \pm 5 \pmod {12}$ I know how to prove that $ (3/p) = 1$ if $ p \equiv \pm 1 \pmod {12}$ but I need to prove that $ (3/p) = -1$ if $ p \equiv \pm 5 \pmod {12}$, which the book write it as it is without explaining why after explaining the first case thoroughly. Could anyone explain for me why this is true please? 
 [/INST] A possible way is as follows. Both rely on the following fact: Let $p>3$ be prime. $-3$ is a quadratic residue modulo $p$ if and only if $p\equiv 1\pmod{6}$. Now, let me first give a self-contained proof of this fact. Let $x\equiv 2a+1\pmod{p}$ such that $x^2\equiv -3\pmod{p}$ (note that such an $a$ must indeed exist as $p\neq 2$). Now, $4a^2+4a+4\equiv 0\pmod{p}$, that is, $p\mid a^2+a+1$.  This implies, $a^3\equiv 1\pmod{p}$. Now, if $p\equiv 5\pmod{6}$, then letting $p=6\ell+5$, we have $a^{p-1}=a^{6\ell+4}\equiv 1\pmod{p}$. Moreover,  $a^3\equiv 1\pmod{p}$ also implies $a^{6\ell+3}\equiv 1\pmod{p}$, and thus, $a\equiv 1\pmod{p}$, which yields $a^2+a+1\equiv 3\pmod{p}$, which is clear contradiction. Thus. $p\not\equiv 5\pmod{6}$, and since  $p>3$ we deduce   $p\equiv 1\pmod{6}$. Now,
Case 1 If $p\equiv 5\pmod{12}$, we also enjoy $p\equiv 1\pmod{4}$, and thus, $(\frac{3}{p})=(\frac{-3}{p})=-1$ (where the second equality follows from the fact above) this clearly yields $3$ is not a quadratic residue modulo $p$.
Case  2 Now, let $p\equiv 7\pmod{12}$. Then, $-3$ is a quadratic residue modulo $p$, whereas $-1$ is not, and thus, $3$ is not a q. residue either.
Edit: (to address a comment by @rtybase below). I believe this argument should also extend to composite $p$. If $p=p_1^{\beta_1}\cdots p_k^{\beta_k}$, then $-3$ is a quadratic residue modulo $p$ if and only if $-3$ is a quadratic residue modulo $p_i$ for every $i $ (if $-3$ is a q. residue modulo $p$, then it must also be so for any $p_i$. conversely, we can establish by Chinese remainder theorem that, if $x^2\equiv -3\pmod{p_i}$ holds, then we can  pass to  $p$. From $p_i\to p_i^{\beta_i}$ is also not hard, and is well-known. 
</s>