Find a function f:R->R (R the set of real numbers), such that
1. f has a discontinuity in every rational number, but is continous everywhere else, and
2. f is monotonic: x<y → f(x)<f(y)
Note: Textbooks frequently present examples of functions that meet only the first condition; requiring monotonicity makes for a slightly more challenging problem.
(In reply to re: Uncle!
The function is continuous at irrationals if you
can always pick an epsilon so that all values within the epsilon
neighborhood are arbitrarily close to the value of the function at the
My text gives as an example:
F(x) = 0 if x irrational,
= 1/n where x is a rational expressible as m/n,
where m and n are relatively prime.
For instance, this is continuous at Pi.
I can always find a small neighborhood of Pi such that all rationals in
the neighborhood evaluate to something that is arbitrarily close to
However, this is discontinuous at 2. F(2) = 1/2,
but every neighborhood of 2, no matter how small, contains irrationals
(whose function has a value of 0).
Edited on August 18, 2006, 10:34 am