The question (Folland's Real Analysis, 3.5.30) asks to produce an increasing function on $\mathbb{R}$ whose set of discontinuities is the rationals. My train of thought is as follows:

Let $f_0$ be the identity. We want to create a jump at every rational number, while keeping the function increasing. Create $f_1$ by cutting $f_0$ at each integer, and halving the slope of each resulting line segment, fixing the left endpoints. This results in a sort of slanted stair that is still increasing and discontinuous exactly at the integers. Given $f_{n-1}$, we create $f_n$ by cutting each segment of $f_{n-1}$ into $n$ parts and halving the slope of each resulting segment, again fixing the left endpoints. Note: this is equivalent to making cuts at all rational points $\frac{m}{n!}$ at the $n^\text{th}$ step, with $m$ and $n$ not necessarily coprime.

The limit of such sequence of functions exists. It's easy to prove that any rational point is eventually a left endpoint, and is thus kept fixed by all successive functions in the sequence. For an irrational point $x$ we can make two sequences $a_n$ and $b_n$ of rationals converging from the left and right respectively, such that $a_n=\frac{m}{n!}<x$ and $b_n=\frac{m+1}{n!}>x$. Given $\epsilon$, we can then choose $N$ large enough with $a_N$ and $b_N$ on the same segment of $f_{N-1}$ (so the jump from $f_{N-1}(a_N)$ to $f_{N-1}(b_N)$ is small), with this jump being less than $\epsilon$. Since we can pinpoint the value of $f_n(x)$ between arbitrarily close values, the limit $f(x)=\lim_n f_n(x)$ exists.

It's clear that the function is discontinuous at all rationals since it is constructed to be, and it is increasing since each $f_n$ is increasing.

Can I say that $f$ is continuous at each irrational? My gut feeling is that, since any $\delta$-ball around an irrational contains a rational to the left and one to the right, we cannot necessarily say $f$ is continuous there. However we know by theorem 3.23 in the book that the set of discontinuities of an increasing function is countable. Is there a contradiction somewhere? If so, can the construction be tweaked or is a different construction necessary?

Thank you.

  • 1
    $\begingroup$ Your construction looks promising. A function can be continuous at $x$ even if every neighbourhood of $x$ contains a point of discontinuity (e.g., let $f(x)$ be $0$ if $x$ is rational and be $x$ if $x$ is irrational, then $f$ is continuous at $0$). Try constructing the $\epsilon$-$\delta$ proof that your function is continuous at irrational numbers. $\endgroup$
    – Rob Arthan
    Nov 21, 2018 at 23:55
  • $\begingroup$ What I'm thinking is this: let $\epsilon>0$, assume there exists $\delta$ such that in a $\delta$-ball around $x$, $|f(x)-f(y)|<\epsilon$. Take two such rationals $p$ and $q$; then we have $|f(p)-f(q)|<2\epsilon$ by triangle inequality. Is this a problem? $\endgroup$
    – Luca S.
    Nov 21, 2018 at 23:56
  • $\begingroup$ I don't think so. Write the $\epsilon$-$\delta$ argument down and check it for yourself. $\endgroup$
    – Rob Arthan
    Nov 22, 2018 at 0:01
  • 2
    $\begingroup$ I upvoted the question since I think your approach will work. Would you be interested in another function having the required properties? [I have one for which the properties are somewhat simple to show.] $\endgroup$
    – coffeemath
    Nov 22, 2018 at 4:35
  • $\begingroup$ Sure, go ahead! $\endgroup$
    – Luca S.
    Nov 22, 2018 at 7:17

1 Answer 1


There is a simpler construction:

If we take a numeration $(q_n)_{n \in \mathbb{N}}$ of $\mathbb{Q}$, we can define $$f(x) := \sum_{k=1}^\infty \frac{1}{2^k} 1_{[q_k, \infty)}(x).$$ The convergence is uniform and this function is monotone increasing by construction. Since all $1_{[q_n,\infty)}$ are continuous in all points of $\mathbb{R} \setminus \mathbb{Q}$, the limes is this too: If $x$ is irrational, then we can take $\varepsilon >0$ so small that $(x-\varepsilon,x+\varepsilon)$ doesn't contain the points $q_1,\ldots,q_n$. So $$|f(x)-f(y)| \le \sum_{k=n}^\infty 2^{-k} = 2^{1-n}.$$

Fix $n$. For any $\max_{q_i < q_n,i=1,\ldots n} q_i < x < q_n < y < \max_{q_i > q_n,i =1 \ldots, n} q_i $we have $f(x) + 2^{-n} < f(y)$. Thus $f$ is discontinuous in any point of $\mathbb{Q}$.

  • $\begingroup$ I'm having such a hard time visualizing a function constructed like this. The proof is sound though. $\endgroup$
    – Rchn
    Nov 22, 2018 at 10:38
  • 1
    $\begingroup$ In fact, you cannot really visualize this function. The key point is that we only add a jump of height $2^{-n}$ in every step. Define $g(x) = \sum_{k=1}^\infty \frac{1}{2^k} 1_{[1/k,\infty)}$. This function has in $x=0$ the same behaviour (and can be visualized): In every neighboorhoud $(-\varepsilon,\varepsilon)$ we have infinite many jump-discontinuities. However, $g$ is continuous in $x=0$! $\endgroup$
    – p4sch
    Nov 22, 2018 at 20:49
  • $\begingroup$ @p4sch How did you get that $f(x)+2^{-n}<f(y)$? $\endgroup$
    – user330477
    Nov 19, 2020 at 13:11
  • $\begingroup$ Since $x < q_n < y$, the sum defining $f(y)$ counts the jump occuring from $q_n$ with height $2^{-n}$, while $f(x)$ does not count this jump. Of course, there are other rational numbers between $q_n < y$ and thus it is a strict inequality. $\endgroup$
    – p4sch
    Nov 20, 2020 at 10:45
  • $\begingroup$ @p4sch Great example! Just out of curiosity: Define the inverse of $f$ by $f^{-1}(y)=\inf\{x:f(x)>y\}$. Then $f^{-1}$ should be continuous on $(0,1)$ with flat regions. But the length of each flat region seems arbitrarily small. Can we say $f^{-1}$ is strictly increasing everywhere? $\endgroup$
    – Ecthelion
    Apr 21 at 2:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.