Sqrt(k) is rational iff it equals a/b, where a and b are integers.
Then k =a^2/b^2
and k*b^2 = a^2.
This is only possible if integer k is also square.
Therefore, sqrt(k) is rational iff the integer k is a square.