I am rereading a book on methods of proof and thought I would try proving that if $n^2$ is odd, then $n$ is odd. The proofs for this that I have seen online mostly involve a proof by contrapositive. I was wondering if this could be done by direct proof instead. I found a direct proof in Mark Bennet's answer to this question. It goes:
Suppose $n^2$ is odd, then $n^2=2m−1$ and $(n+1)^2=2(m+n)$
Now $2$ is prime and $2∣(n+1)^2$ so $2∣n+1$ therefore $n+1=2r$ (for some integer r) whence $n=2r−1$ and $n$ is odd.
I came up with a separate proof and I was wondering if it is logically sound:
Suppose $n^2$ is odd, then $n^2=2m+1$ for some $m \in \mathbb{Z}$.
$n^2=2m+1 \implies n^2-1 = 2m \implies (n+1)(n-1) = 2m$
This shows $(n+1)(n-1)$ is even; for this to be true, at least one of $n+1$ and $n-1$ must be even, which means that $n$ is odd.
Is this proof written well? Does it have gaps? If there are problems with it, I would like to ensure that I do not make those same mistakes in the future.