# Construct a monotone function which has countably many discontinuities

I read in a textbook, which had seemed to have other dubious errors, that one may construct a monotone function with discontinuities at every point in a countable set $C \subset [a,b]$ by enumerating the points as $c_1, c_2, \dots$ and defining $f(x) = \sum_{c_n < x}2^{-n}$. However, if seems that if we let $[a,b] = [0,1], C = \mathbb{Q} \cap [0,1]$, then $f(x)$ is constant $1$ everywhere except 0, an apparent counterexample.

So my question is: how does one construct a monotonic function which has discontinuities precisely on a countable set $C$? Further, are there any relatively easy-to-visualize constructions?

• "then f(x) is constant 1 everywhere except 0" - I don't think this claim is correct. In fact, $f$ will be strictly smaller than 1 everywhere. – Srivatsan Oct 2 '11 at 19:14
• What are the summation limits and index on the example? – Andrew Christianson Oct 2 '11 at 19:15
• I see. This depends on the enumeration. Great! Question answered. – JeremyKun Oct 2 '11 at 19:26
• Since $\sum_{n=10}^\infty 2^{-n}$ is so small, you can see almost exactly what your function will look like if you plot it (with Matlab, say) using only the ten first rationals in your enumeration. – Samuel Oct 2 '11 at 19:38

The construction is correct. I’ll use your example as an illustration. Let $\{q_n:n\in\omega\}$ be an enumeration of $\mathbb{Q}\cap [0,1]$, and let $f(x)=\sum\limits_{q_n<x}2^{-n}$ for $x\in [0,1]$.
First consider what happens at some $q_m$: $$\lim\limits_{x\to {q_m}^-}f(x) = \sum_{q_n<q_m}2^{-n}=f(q_m),$$ because as $x$ moves up towards $q_m$, $\{q_n:q_n<x\}$ includes more and more of the rationals less than $q_m$. Thus, $f$ is continuous from the left at $q_m$, but for every $x>q_m$ we have $$f(x)=\sum_{q_n<x}2^{-n} \ge \sum_{q_n\le q_m}2^{-n} = f(q_m)+2^{-m},$$ so $f$ jumps by at least $2^{-m}$ at $q_m$. In fact $$\lim_{x\to {q_m}^+}f(x) = f(q_m)+2^{-m},$$ and the jump is exactly $2^{-m}$.
At each irrational $a \in [0,1]$, however, $f$ is easily seen to be continuous: $$\lim_{x\to a^-}f(x) = \lim_{x\to a^+}f(x) = \sum_{q_n<x}2^{-n}=f(x).$$
• @Bean: That it does, very definitely. So you get a bonus: since there are $2^\omega$ enumerations of a countably infinite set, you get $2^\omega$ examples for a given set of points of discontinuity for the price of one. :-) – Brian M. Scott Oct 2 '11 at 19:47