I tried to prove that $n^2 - 7$ is not divisible by $5$ via proof by contradiction. Does this look right?
Suppose $n^2 - 7$ is divisible by $5$. Then:
$n^2 - 7 = 5g$, $g \in \mathbb{Z}$.
$n^2 = 5g + 7$.
Consider the case where $n$ is even.
$(2x)^2 = 5g + 7$, $x \in \mathbb{Z}$.
$4x^2 = 5g + 7$.
$4s = 5g + 7$, $s = x^2, s \in \mathbb{Z}$ as integers are closed under multiplication.
$2s$ is even, and $5g + 7$ is odd if we consider that g is an even number. so we have a contradiction.
Consider the case where $n$ is odd.
$(2x + 1)^2 = 5g + 7$, $x \in \mathbb{Z}$
$4x^2 + 4x = 5g + 6$
$4x^2 + 4x = 5g + 6$
$4(x^2 + x) = 5g + 6$
$4j = 5g + 6$, $j = x^2 + x, j \in \mathbb{Z}$ as integers are closed under addition
$2d = 5g + 7$, $d = 2j; d \in \mathbb{Z}$ as integers are closed under multiplication
$2d$ is even, and $5g + 7$ is odd if we consider that g is an odd number. An even number cannot equal an odd number, so we have a contradiction.
As both cases have a contradiction, the original supposition is false, and $n^2 - 7$ is not divisible by $5$.
is my proof correct because I cannot prove that $5g + 6$ or $5g + 7$ are odd so I assumed that in the even case g is even and in the odd case g is odd
It seems rather overcomplicated. Instead, simply note that the question is equivalent to solving $n^2 - 2 = 0$ in $\mathbb{Z}/5\mathbb{Z}$. But there are only five values in $\mathbb{Z}/5\mathbb{Z}$, and we can just try them all to see if they're solutions:
\begin{align*} 0^2 - 2 &= -2 \neq 0\\ 1^2 - 2 &= -1 \neq 0\\ 2^2 - 2 &= 2 \neq 0\\ (-1)^2-2 &= -1 \neq 0\\ (-2)^2-2 &= 2 \neq 0. \end{align*}
None of them are solutions, so there are no solutions to the original problem.