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