Suppose $\sqrt 2$ were rational. Then we would have integers $a$ and $b$ with $\sqrt 2 = \frac ab$ and $a$ and $b$ relatively prime.
Since $\gcd(a,b)=1$, we have $\gcd(a^2, b^2)=1$, and the fraction $\frac{a^2}{b^2}$ is also in lowest terms.
Squaring both sides, $2 = \frac 21 = \frac{a^2}{b^2}$.
Lowest terms representations of rational numbers are unique, so we have $a^2 = 2$ and $b^2=1$.
But there is no such integer $a$, and therefore we have a contradiction and $\sqrt 2$ is irrational.
I am not interested in the pedagogical value of this purported proof; I am only interested in whether the logic is sound.