Let $p$ be a prime number. Show that $\sqrt{p}$ is a irrational number.
Attempt: Suppose for contrary that $\sqrt{p}$ is a rational number. Then, $$\sqrt{p}=\frac{m}{n} \qquad (1),$$ for some integers $m$ and $n$ with $n \ne 0$ and $\gcd(m,n)=1$. By squaring both side of $(1)$, we obtain $$p=\frac{m^2}{n^2} \implies m^2 = pn^2 \implies p\mid m^2. \qquad (2)$$ We'll show that if $p\mid m^2$, then $p \mid m$. Suppose for the contrary that $p \nmid m$. Then, $m=pq+r$, for some integer $q$ and $r$ with $0<r<p$. Hence, $$m^2=(pq+r)^2=p^2q^2+2pqr+r^2.$$ Since $p \mid m^2$, then $p \mid p^2q^2+2pqr+r^2$, which means $p \mid r^2$. But, since $0<r<p$, we have $p \nmid r^2$, a contradiction. So, if $p \mid m^2$, then $p \mid m$. Now, on $(2)$, we get $p \mid m$. It means there is an integer $k$ such that $m=pk$. Plugging this in to the relation $m^2=pn^2$, we have $p^2k^2=pn^2$, which implies that $p \mid n$. Since $p \mid m$ and $p \mid n$, then $\gcd(m,n) \ge p>1$, since $p$ is a prime number. Contradiction with the assumption that $\gcd(m,n)=1$. Therefore, $\sqrt{p}$ is a irrational number.
Does the above approach correct, especially in the proof of implication: "If $p\mid m^2$, then $p \mid m$" (without using Euclid's Lemma; that is, by an elementary approach)? Thanks in advanced.