The

proof that the

square root of any

prime number is

irrational is easy using

prime decomposition. We use

proof by contradiction: suppose that sqrt(n) is

rational. Then

n = a^{2}/b^{2}

for some a and b. Now write a and b as products of prime factors, and cancel any common factors. Then we have

n = p_{1}^{2}×p_{2}^{2}×···/q_{1}^{2}×q_{2}^{2}×···

where p_{1}, p_{2}, …, q_{1}, q_{2}, … are primes and p_{j}≠q_{k} for all j, k. (This is just a fancy way of saying there are no common factors.)

But n is an integer. Therefore the denominator q_{1}^{2}×q_{2}^{2}×… is equal to unity. If it were not, then the numerator would have a common factor with the denominator, since it would be an integer multiple of the denominator; but we already cancelled all common factors.

Therefore, if sqrt(n) is rational, n is a product of squares of integers, and not a prime. In fact we have proved a stronger statement: the square root of any non-square number is irrational. Thus, the square root of any integer is either an integer, or irrational.

The original statement has a slightly more elegant proof using the fundamental theorem of arithmetic, to be precise the fact that the prime decomposition is unique.
If sqrt(n) is rational, then

n×b^{2} = a^{2}.

The prime decomposition is unique, therefore the number of prime factors must be the same on both sides. Both a^{2} and b^{2}, being squares, have an even number of prime factors. But n is prime.
Therefore the LHS has an odd number of prime factors, and we have a contradiction. This also proves that the square root of *any* integer with an odd number of prime factors is irrational.

http://www.cut-the-knot.org/proofs/sq_root.shtml