[Math] Establishing the existence of a strictly increasing real function, discontinuous at all rationals and continuous at all irrationals

real-analysis

Goal: Show that there exists a strictly increasing function on $\mathbb{R}$ discontinuous at all points of $\mathbb{Q}$ and continuous at all irrational numbers.

Attempt:

  1. Let $f(x)$ denote the popcorn function on $\mathbb{R}$ s.t.

$$
f(x) =
\begin{cases}
\frac{1}{q} &\text{if }x\text{ is rational, }x=\tfrac{p}{q}\text{ in lowest terms and } q > 0\\
0 &\text{if }x\text{ is irrational.}
\end{cases}
$$

The popcorn function $f(x)$ can be visualized on $(0,1)$ as follows:

enter image description here

  1. Let $g(x): \mathbb{R}_{\ge 0}\rightarrow \mathbb{R}$ denote the following function:

$$
g(x) =
\begin{cases}
0 &\text{if }x=0\\
\sup\{g(y) : y < x\} + \frac{1}{q} &\text{if }x>0\text{ is rational, }x=\tfrac{p}{q}\text{ in lowest terms and } q > 0\\
\sup\{g(y) : y < x\} &\text{if }x>0\text{ is irrational.}
\end{cases}
$$

  1. Extend $g(x)$ to all of $\mathbb{R}$ by making $g(-x) = -g(x)$. We'll refer to this extended function as $g(x)$ as well (abusing the name $g$ without harm).

  2. $g$ is strictly increasing: Let $x < y$. Then there exists a fully reduced rational $p/q \in (x,y)$ so that

$$
g(x) < g(x) + p/q \le g\left(p/q\right) \le g(y)
$$

which implies $g(x) < g(y)$ as desired.

  1. $g$ is discontinuous at all points of $\mathbb{Q}$: Let $x = {p \over q}$ be a fully reduced rational. We can further assume $x$ is positive without loss of generality. Let $\epsilon = {1 \over q}$. Then for any $\delta > 0$, we have that $(x- \delta, x)$ contains at least one rational $y$ so that

$$
g(y) < g(y) + {1 \over q} \le g(x)
$$

This in particular implies that $g(y) \notin (g(x)- \epsilon, g(x)+\epsilon)$ so that $g$ fails to be continuous at $x$ as desired.

Question: How can I show that $g$ is continuous at all irrational points?

Best Answer

My suggestion: Try $$ g(x)=\sum_{0\le q\le x}f(q)^3$$ or $$ g(x)=\sum_{n\in\mathbb N}\frac{\lfloor nx\rfloor}{n^3}$$ for $x>0$ and then $$h(x)=\begin{cases}g(x)&\text{if }x>0\\0&\text{if }x=0\\-g(-x)&\text{if }x<0\end{cases}$$

Related Question