Provide a counterexample: If $n^2-1$ is divisible by $5$, then $n$ is divisible by $2$ or $3$
My book doesn't have an answer to this question, but I think it's $n=6$. Since $6^2-1=35$, which is divisible by $5$ but not by $2$ or $3$. Is this the right way to solve these counterexample problems? Are these problems solved by just plugging in numbers until you get to the right one?
Yes! That approach is exactly the right way to do it. A statement like "If $n^2 - 1$ is divisible by $5$, then $n$ is divisible by $2$ or $3$" means it's true for EVERY SINGLE POSSIBLE $n$ out there.
So if you can find even one $n$ where it's not true, then the statement is false!
You can solve counterexample problems by plugging in numbers one by one, but I find it's more insightful to take a two-pronged approach. Try to prove the proposition - and then ask, where are you getting stuck? What is going wrong? Use that to guide finding a counterexample.
In this case, you're not interpreting the problem correctly. Notice that the statement is not $n^2 - 1$ is divisible by $2$ or $3$, but that $n$ is divisible by $2$ or $3$. Since you picked $n=6$, it is in fact divisibly by both $2$ and $3$.
Instead try reasoning along these lines. Suppose $5$ divides $n^2 - 1$. Since $n^2 - 1 = (n+1)(n-1)$ and $5$ is prime, we must have either that $5|(n+1)$ or $5|(n-1)$. That is, either $n = 5k - 1$ or $n = 5k + 1$ for some $k$. So let's search for a number of the form $5k \pm 1$ that is not divisible by $2$ or $3$. Now I'd start listing numbers and looking for ones that are not divisible by $2$ or $3$: $$\ldots\ -1,\ 1,\ 4,\ 6,\ 9,\ 11,\ 14,\ 16,\ 19,\ 21,\ \ldots$$
Extra challenge- is there a pattern you can see here?