Prove that for all integers $n$ if $3 \mid n^2$, then $3 \mid n$ Prove that for all integers $n$ if $3$ | $n^2$, then $3$ | $n$.
I figured using contrapostive was the best method by using the definition "an integer $k$ is not divisible by 3 if and only if there exists an integer $k$ such that $n=3k+1$ or $n=3k+2$. Also using the definition $a$ divides $b$ written $a$|$b$ if $b=ac$ for some $c$ in integers.
Here it goes:
$$3\nmid n$$
$$3k+1=3n$$
$$\frac{3k+1}{3}=n$$

Presumably you have had the division theorem.
For $n$ and integer there exist integer $k, r$ so that $n = 3k + r$ where $0 \le r < 3$.  So $r = 0, 1$ or $2$.
Can you accept that?
If $r=0$ then $3|n$.  
If $r = 1$ then $n^2 = (3k + 1)^2 = 9k^2 + 6k + 1 = 3(3k^2 + 2k) + 1$ and $3\not \mid n^2$ and that's a contradiction.
If $r = 2$ then $n^2= (3k + 2)^2 = 9k^2 + 12k + 4 = 3(k^2 + 4k+ 1) + 1$ and $3\not \mid n^2$ and that's a contradiction.
So if $3|n^2$ then the only possibility is $n = 3k$ for some $k$.
