define f(x)= 1 if x is rational

cos x if x is irrational

and f(x)= x^2 if x is rational

1/x^2 if x is irrational

i understand its by using sequences of rationals that converge to irrationals and vice versa...but can someone explain to me how to find the points at which they are continous??