If possible,let √p be a rational number.
also a and b is rational.
then,√p = a/b
on squaring both sides,we get,
(√p)²= a²/b²
→p = a²/b²
→b² = a²/p [p divides a² so,p divides a]
Let a= pr for some integer r
→b² = (pr)²/p
→b² = p²r²/p
→b² = pr²
→r² = b²/p [p divides b² so, p divides b]
Thus p is a common factor of a and b.
But this is a contradiction, since a and b have no common factor.
This contradiction arises by assuming √p a rational number.
Hence,√p is irrational.