Prove: $3 \nmid n \Leftrightarrow 3 \mid (n^2 -1)$ Been learning how to work with divisibility proofs, and I really need some help understanding this proof. I want to show that $3 \nmid n$ $\Leftrightarrow $ $3 \mid (n^2 -1)$. So, I want to go from say $3 \mid (n^2 -1)$ to $3 \nmid n$ and $3 \nmid n$ to $3 \mid (n^2 -1)$ by proof.
I wanted to start off with $3 \mid (n^2 -1)$ $\implies$ $3 \nmid n$, so I did the following:
If we are given $3 \mid (n^2 -1)$, then $n^2-1=3\cdot a$ for some $a\in \mathbb{Z}$.
This is equivalent to saying $(n-1)(n+1)=3\cdot a$.
So either $(n-1)$ or $(n+1)$  is a multiple of $3$.
Here is where I got a bit stuck, I'm not sure exactly what to do, perhaps considering whether $n$ is odd or even and proceeding from there? I'm even more unsure about the other direction, namely $3 \nmid n$ to $3 \mid (n^2 -1)$. Please help a novice out.

You are almost done with your first direction.
When either $(n-1)$ or $(n+1)$ is a multiple of 3 then $n$ cannot be a multiple of 3.
The other direction works analogously. If $n$ is a multiple of 3, then $(n-1)$ and $(n+1)$ cannot be multiples of three and therefore $n^2 -1$ is neither a mulitple of 3.
