Copyright © University of Cambridge. All rights reserved.
This is Hyeyoun's solution.
Suppose that $\sqrt{a}$ is rational. Therefore, where $x$ and $y$ are coprime integers and $y \ne 0$, we have \[ a = \frac{x^2}{y^2} \]
We can always write the rational number so that x and y are coprime, that is they have no common factors except 1 so, as $\sqrt a$ is rational, it follows that $x$ and $y$ are coprime.
If $a$ is an integer, $y^2$ must be a factor of $x^2$ and so $y=1$.Therefore $a$ is a square number.
It follows (as the contrapositive) that if $a$ is an integer and is not a square number then $\sqrt{a}$ is irrational.