Artificial intelligent assistant

Prove that if $n$ is not the square of a natural number, then $\sqrt{n}$ is irrational. > **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!!

Let $n$ be a positive integer such that there is no $m$ such that $n = m^2$. Suppose $\sqrt{n}$ is rational. Then there exists $p$ and $q$ with no common factor (beside 1) such that

$\sqrt{n} = \frac{p}{q}$

Then

$n = \frac{p^2}{q^2}$.

However, $n$ is an positive _integer_ and $p$ and $q$ have no common factors beside $1$. So $q = 1$. This gives that

$n = p^2$

Contradiction since it was assumed that $n \
eq m^2$ for any $m$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 98fd65e0823a46c01fcaeb52125c1351