Continuous, Discontinuous, and Bounded Variation

real-analysis

Is there such a function that is continuous at every irrational, discontinuous at every rational, and is also of bounded variation on $[0,1]$? A candidate is Thomae’s Function,

$$f(x) =
\begin{cases}
\frac{1}{x} & x = \frac{p}{q}, \text{and gcd}(p,q) = 1, q > 0 \\
0 & x \text{is irrational}
\end{cases},$$

but it can be shown to be not of bounded variation since we end up with a series $\sum_k^m \frac{1}{k}$.

Best Answer

Let $F(x)=\sum_{r_n \leq x} \frac 1 {2^{n}}$ where $(r_n)$ is an ennumeration of rationals in $[0,1]$. (The sum is over all n such that $r_n \leq x$). Then $F$ has all the desired properties.

Related Question