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

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: 2. 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}$$

3. 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).

4. $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.

5. $g$ is discontinuous at all points of $\mathbb{Q}$: Let $x = {p \over q}$ be a fully reduced irrational. 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 irrational $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?

• You mean to use $\sup f(x)$ in the definition of $g(x)$? – Hagen von Eitzen Apr 26 '14 at 13:17
• I meant to use $\sup g(x)$ so that the function can be strictly increasing. – user1770201 Apr 26 '14 at 13:22
• Then the definitin of $g$ is circular. In fact from $1>\frac12>\frac13>\ldots$, you would require $g(1)\ge 1+g(\frac12)\ge 1+\frac12+g(\frac13)\ge 1+\frac12+\frac13+\ldots$ – Hagen von Eitzen Apr 26 '14 at 13:23

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}$$
• How does one establish that $\sum_{0\le q\le x}f(q)^3$ is continuous on irrational points? I'm assuming this is where the power of $3$ will come in handy. – user1770201 Apr 26 '14 at 14:29
• Hagen von Eitzen Can you help Connection of complex $e^z$ and real Dirichlet please? – BCLC Aug 19 '18 at 6:26