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(3): Oops... Maybe another hint? by Steve Herman)

I agree, Steve. The main reason I'm optimistic that there is a solution is the function w(x) which we know isn't discontinuous for all rationals, but it is for an infinite number of them...

The w function plays with the decimal expansion (not necessarily base 10--I don't know how to say "decimal expansion" in a way to imply any base--but that's what I mean) of a number to arrive at its function value. I'm wondering if the solution to this problem uses a similar trick.

Incidentally, I wasn't convinced of your assertion that the function must be strictly monotonic--but it's true. Here's my reasoning: If there are 2 numbers x and y such that f(x) = f(y), then for all z between x and y, f(z) = f(x) = f(y) which means the function is continuous on that entire interval. But any finite interval contains an infinite number of irrationals, and the function can't be continuous for them. So the function has to be strictly monotonic.