TITLE: Prove that if $n$ is not the square of a natural number, then $\sqrt{n}$ is irrational.
QUESTION [8 upvotes]: Possible Duplicate:
$\sqrt a$ is either an integer or an irrational number. 

I have this homework problem that I can't seem to be able to figure out:Prove: If $n\in\mathbb{N}$ is not the square of some other $m\in\mathbb{N}$, then $\sqrt{n}$ must be irrational. I know that a number being irrational means that it cannot be written in the form $\displaystyle\frac{a}{b}: a, b\in\mathbb{N}$ $b\neq0$ (in this case, ordinarily it'd be $a\in\mathbb{Z}$, $b\in\mathbb{Z}\setminus\{0\}$) but how would I go about proving this? Would a proof by contradiction work here?
Thanks!!

REPLY [5 votes]: This can also be done with the rational root test: consider the polynomial equation $$x^2 - n = 0$$
and suppose that it has a rational root. Then, this rational root must be an (integer) factor of $n$. So, if $\sqrt{n}$ is rational, then there exists $t\in \mathbb{N}$ (since $x^2 - n$ is an even function of $x$, we may assume, without loss of generality, that $t>0$) with $t \vert n$ such that $$t^2 - n = 0$$ which is to say $$n = t^2$$ and hence $n$ is the square of a natural number.
In fact, this argument generalizes to showing that if $\sqrt[m]{n}$ is rational, then $n$ is an $m^{th}$ power.