TITLE: Proving that $\sqrt{2}$ is irrational with a math level of a middle school student?
QUESTION [10 upvotes]: So I have a friend, whose professor challenged the class to prove that $\sqrt{2}$ is irrational by using only middle school math level.
No one managed to do it, and neither did I (although I didn't give it much thought, as I have other stuff to do for the moment), but I am still curious as to how to do it.
Apparently, most of the class thought about using the Pythagorean theorem: $$ a^2 + b^2 = c^2$$ And taking $a=b=1$, but it didn't help them at all.
So any ideas? I know that the middle school levels vary from country to country, but let's just suppose that we are talking about YOUR country's middle school.

REPLY [2 votes]: If $\sqrt 2 = a/b\,$ then $\, 2b^2 = a^2,\,$ but $\,2b^2$ has an odd number of $2$'s in its unique prime factorization whereas $\,a^2$ has an even number of $2$'s, contradiction (be careful - a rigorous proof of this must invoke the existence and uniqueness of prime factorization in several places).
Remark $ $ It's simpler to use $2$-uniqueness, i.e. it is easy to prove that every natural can be written uniquely in the form $\, 2^i n\,$ for odd $\,n,\,$ thus $\, A= 2^{\large J} a,\ B = 2^{\large K} b\,$ for $\,a,b\,$ odd. Hence we deduce that $ A^2\! = 2 B^2$ $\Rightarrow$ $2^{\color{#c00}{\large 2J}} a^2 = 2^{\color{#0a0}{\large 1+2K}} b^2.\, $ But $\,a,b\,$ odd $\,\color{#f2f}\Rightarrow$ $\,a^2,b^2\,$ odd too, contra $2$-uniqueness (the power of $2$ on LHS is $\,\color{#c00}{{\rm even}\!=\! 2J}\,$ vs. $\,\color{#0a0}{1\!+\!2K\rm\!=\!odd}\,$ on RHS.
The above shows how the ubiquitous parity proof in Vasya's answer is intimately connected to unique factorization.
Similarly for $n$'th roots: if $\,2^{1/n} = A/B\,$ then $A^n = 2B^n$ so $\,2^{nJ}a^n = 2^{1+nK}b^n$ so $\,nJ = 1+nK,\,$ so $\,n\mid 1$, i.e. the powers of $\,2\,$ are incongruent $\!\bmod n$ (vs. $\!\bmod 2$ as above), contra $2$-uniquness.
To generalize this proof from $\,p = 2\,$ to an arbitrary prime $\,p\,$ would require generalizing the $\,\rm odd^{\large 2}\! = odd\,$ step that we used above, $ $ i.e. we would need  a proof of the following inference $\ p\nmid a,b\,\color{#f2f}\Rightarrow\, p\nmid a^{\large 2},b^{\large 2}.\ $ Just as for the case $\,p=2,\,$ for any $\rm\color{#c00}{fixed}$ prime $\,p\,$ we could prove it by a brute-force case analysis, i.e. $\!\bmod p\!:\  a^2\equiv (a\bmod p)^2$ and $\,a\bmod p\in \{\color{#90f}{0,1,2,\ldots p\!-\!1}\},\,$ so it sufices to show $\,0\,$ is the only of those $\,\color{#90f}{p\ \rm integers}$ that squares to $\,0\pmod{\! p}.\,$   But to prove this for $\rm\color{#c00}{every}$ prime $\,p\,$ requires much  deeper results, e.g. Euclid's lemma $\ p\mid ab\,\Rightarrow\, p\mid a\,$ or $\,p\mid b\ $ (or closely related results).