Let $n$ be an integer. Prove that if $3 \vert n^2$ then $3 \vert n$.
Use the result from above to prove $\sqrt{3}$ is also irrational.
So for the first part I did the contrapositive
$\neg (3 \vert n$) then $\neg (3 \vert n^2)$
But how do i do cases for this and how to do the second part?
Hint: use the decompostion of $n$ in prime factors.