I have to either give an example or show that no such function exists: A real valued function f(x) continuous at all irrationals and at all the integers, but discontinuous everywhere else. I think such function exists and I would define it as follows: f(x) = 0 if x is an irrational or an integer 1/q if x is rational (p/q) but not an integer. This way the proof is similar to the case for continuous for irrationas, discontinuous everywhere else. Each rational can be viewed as a limit of a sequence of irrationals, right? So those rationals that have the same value as that sequence (integers in my case) will be continuous, those that don't won't be. Does this sound right?