6. Find the prime $p$ for which 6 is a quadratic residue.

The text has been translated while preserving the original line breaks and format.
6. Solution: We have
$$\left(\frac{6}{p}\right)=\left(\frac{2}{p}\right)\left(\frac{3}{p}\right)$$

By Lemma 9 and Problem 4, we have respectively
$$\begin{array}{l}
\left(\frac{2}{p}\right)=\left\{\begin{array}{l}
1, p \equiv \pm 1(\bmod 8) \\
-1, p \equiv \pm 3(\bmod 8)
\end{array}\right. \\
\left(\frac{3}{p}\right)=\left\{\begin{array}{ll}
1, & p \equiv \pm 1(\bmod 12) \\
-1, & p \equiv \pm 5(\bmod 12)
\end{array}\right.
\end{array}$$

Therefore, for $\left(\frac{6}{p}\right)=1$, it is necessary that $\left(\frac{2}{p}\right)$ and $\left(\frac{3}{p}\right)$ are both 1 or both -1. This leads to the following eight systems of congruences:
$$\begin{array}{c}
\left\{\begin{array}{l}
p \equiv 1(\bmod 8) \\
p \equiv 1(\bmod 12)
\end{array},\left\{\begin{array}{l}
p \equiv 1(\bmod 8) \\
p \equiv-1(\bmod 12)
\end{array},\left\{\begin{array}{l}
p \equiv-1(\bmod 8) \\
p \equiv 1(\bmod 12)
\end{array}\right.\right.\right. \\
\left\{\begin{array}{l}
p \equiv-1(\bmod 8), \\
p \equiv-1(\bmod 12),
\end{array}, \begin{array}{l}
p \equiv 3(\bmod 8), \\
p \equiv 5(\bmod 12),
\end{array},\left\{\begin{array}{l}
p \equiv 3(\bmod 8) \\
p \equiv-5(\bmod 12)
\end{array}\right.\right. \\
\left\{\begin{array}{l}
p \equiv-3(\bmod 8), \\
p \equiv 5(\bmod 12),
\end{array},\left\{\begin{array}{c}
p \equiv-3(\bmod 8) \\
p \equiv-5(\bmod 12)
\end{array}\right.\right.
\end{array}$$

The second system, when simplified modulo 4, leads to a contradictory system of congruences $p \equiv 1(\bmod 4), p \equiv-1(\bmod 4)$, hence it has no solution; similarly, the 3rd, 5th, and 8th systems of congruences also have no solutions.

From the 1st, 4th, 6th, and 7th systems of congruences, we obtain the following four equivalent systems of congruences:

Solving these, we find that $p$ is a quadratic residue of 6 if and only if $p \equiv \pm 1, \pm 5(\bmod 24)$. Similarly, by solving the remaining systems of congruences, we can prove that $p$ is a quadratic non-residue of 6 if and only if $p \equiv \pm 7, \pm 11(\bmod 24)$.
$$\begin{array}{l}
\left\{\begin{array} { l } 
{ p \equiv 1 ( \operatorname { m o d } 8 ) , } \\
{ p \equiv 1 ( \operatorname { m o d } 3 ) , }
\end{array} \quad \left\{\begin{array}{l}
p \equiv-1(\bmod 8), \\
p \equiv-1(\bmod 3),
\end{array}\right.\right. \\
\left\{\begin{array} { l } 
{ p \equiv 3 ( \operatorname { m o d } 8 ) , } \\
{ p \equiv - 5 ( \operatorname { m o d } 3 ) , }
\end{array} \quad \left\{\begin{array}{l}
p \equiv-3(\bmod 8), \\
p \equiv 5(\bmod 3),
\end{array}\right.\right.
\end{array}$$