I have to either give an example or show that no such function exists:(adsbygoogle = window.adsbygoogle || []).push({});

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?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Function continuous at irrationas and integers

**Physics Forums | Science Articles, Homework Help, Discussion**