# Is there a monotonic function discontinuous over some dense set?

Problem (for fun--not homework)

Can we construct a monotonic function $f : \mathbb{R} \to \mathbb{R}$ such that there is a dense set in some interval $(a,b)$ for which $f$ is discontinuous at all points in the dense set? What about a strictly monotonic function?

My intuition tells me that such a function is impossible.

Here is a rough sketch of an attempt at proving that such a function does not exist: we could suppose a function satisfies these conditions. Take an $\epsilon > 0$ and two points $x,y$ in this dense set such that $x<y$. Then, $f(x)<f(y)$ because if they are equal, then the function is constant at all points in between, and there is another element of $X$ between $x$ and $y$, which would be a contradiction. Take $f(y)-f(x)$. By the Archimedean property of the reals, $f(y)-f(x)<n\epsilon$ for some $n$.

However, after this point, I am stuck. Could we somehow partition $(x,y)$ into $n$ subintervals and conclude that there must be some point on the dense set that is continuous?

-

Such a function is possible.

Let $\Bbb Q=\{q_n:n\in\Bbb N\}$ be an enumeration of the rational numbers, and define

$$f:\Bbb R\to\Bbb R:x\mapsto\sum_{q_n\le x}\frac1{2^n}\;.\tag{1}$$

The series $\sum_{n\ge 0}\frac1{2^n}$ is absolutely convergent, so $(1)$ makes sense. If $x<y$, there is some rational $q_n\in(x,y)$, and clearly $f(y)\ge f(x)+\frac1{2^n}$, so $f$ is monotone increasing. However, $f$ is discontinuous at every rational:

$$\lim_{x\to {q_n}^-}f(x)=\sum_{q_k<q_n}\frac1{2^k}<\sum_{q_k\le q_n}\frac1{2^k}=f(q_n)\;.$$

Thus, $f$ is discontinuous on a set that is dense in $\Bbb R$ (and in every open interval of $\Bbb R$).

-
Seriously? I was just typing that... –  Asaf Karagila Jul 19 '12 at 7:09
@Asaf: It’s a pretty standard example, I think. –  Brian M. Scott Jul 19 '12 at 7:10
True.${}{}{}{}$ –  Asaf Karagila Jul 19 '12 at 7:11
It seems that this assumes that there is an enumeration of the rational numbers that preserves ordering on the reals, unless I'm reading it wrong. That is $q_n>q_m$ iff $n>m$. Is there such an enumeration? –  Andrew Salmon Jul 19 '12 at 7:14
@AndrewSalmon: Of course there is not. It also does not assume that. –  Asaf Karagila Jul 19 '12 at 7:15