Say sqrt(n) is rational. Then sqrt(n) =p*/q* where since p* and q* are integgers we can factor this fraction in such way that the denominator and the numerator have no common factor, say p/q. It follows thar:
sqrt(n)=p/q (p and q relatively prime) or
n =p^2/q^2 or p^2=q^2*n
in other words q^2 divides p^2 and so they must have common fators. Thus either q=1 or there is a contradiction in assuming that sqrt(n) is a rational number.