Q:

Prove that $\sqrt 5$ is irrational

I have to  prove that $\sqrt 5$ is irrational. 
Proceeding as in the proof of $\sqrt 2$, let us assume that $\sqrt 5$ is rational. This means for some distinct integers $p$ and $q$ having no common factor other than 1, 
$$\frac{p}{q} = \sqrt5$$
$$\Rightarrow \frac{p^2}{q^2} = 5$$
$$\Rightarrow p^2 = 5 q^2$$
This means that 5 divides $p^2$. This means that 5 divides $p$ (because every factor must appear twice for the square to exist). So we have, $p = 5 r$ for some integer $r$. Extending the argument to $q$, we discover that they have a common factor of 5, which is a contradiction.
Is this proof correct?

A:

It is, but I think you need to be a little bit more careful when explaining why $5$ divides $p^2$ implies $5$ divides $p$. If $4$ divides $p^2$ does $4$ necessarily divide $p$?

A:

Yes, the proof is correct. Using this method you can show that $\sqrt{p}$ for any prime $p$ is irrational. During the proof you essentially use the fact that when $p|u^2$ where $p$ is a prime, then it implies that $p|u$. This is true for primes, but is not true in general. You can prove this as below
 Let $n|u^2,\ \gcd(n,u)=d$. Then, let $n=rd,\ u=sd $. So, $$u^2=kn \Rightarrow s^2d^2=k r d\Rightarrow s^2d=kr$$ if we have $n\not{|}\ u$, since $\gcd(s,r)=1$, we have $$r|d$$ Then, with $d>1$, $n\not{|}\ u$, but $\ n|u^2$. If $n$ is prime, then $d=1\Rightarrow r=1$ unless $\ n|u$.

