hi!

I'm looking for a strictly increasing function on I = [0, 1] that is continuous only at the irrational numbers in I.

After some thought, I came up with the following arrangement.

Enumerate the rational numbers in I as such: $\displaystyle q_1, q_2, q_3, ... , q_n$ (with n a natural number) such that $\displaystyle q_k < q_{k+1}$

Let $\displaystyle f(x) = 2^k $ if $\displaystyle x = q_k $ (for 1 <= k <= n)

and $\displaystyle f(x) = (2^k + x)$ if x is irrational and $\displaystyle q_k < x < q_{k+1}$

Is the function continuous at x irrational? I think so.

For any Epsilon > 0, choose Delta = $\displaystyle min (x - q_k, q_{k+1} - x) * 0.5$ so that for any x' satisfying $\displaystyle |x' - x| < Delta$ we have $\displaystyle |f(x')-f(x)| < Epsilon$.

Is the function discontinuous at x rational? I think that can be shown using similar reasoning.

Am I close? If not, can I modify my function to meet the requirement?