If $n$ divides $m$, then $n$ divides $m^2$ I have been asked in one of my problem sheets to prove that if $3$ divides $n$, then $3$ divides $n^2$. 
So what I did was: Write $n=3d$, $d$ is an integer. So $n^2=9d^2$, therefore $n^2=3*3d^2=3c$, where $c$ is an integer. 
QED. 
But then the same method works in general for any number other than $3$. 
Where am I making a mistake? 

See that $n^2=n.n$. Now we are given that $3|n$ or $3k=n$ for some integer $k$. Substituting it in the first result, we get $n^2=3k.n$.  Let $kn=p$ for some integer $p$, so $n^2=3p$ which shows that $3|n^2$.  
Remark: Can you prove the converse of your question also? That is, if $3|n^2$, then prove that $3|n$. (But keep in mind that the number which is dividing will always be a prime). Otherwise, it won't be true.  
Hint: Use the fundamental theorem of Arithmetic.
