Problem: 2012-09-04

Problem 1.1.37 (Berkeley Problems in Mathematics). Let $S$ be the set of continuous real-valued functions on $[0,1]$ such that $f(x)$ is rational whenever $x$ is rational. Prove that $S$ is uncountable.

Solution. My initial idea here is to find a way of encoding binary sequences as functions of the kind described above. A binary sequence can be viewed as a function $\mathbb{N} \to \{ 0,1 \}$, or written out as $a=(a_0, a_1, a_2, \ldots)$. We construct a function $f_a$ from such a sequence as follows. For $k \geq 0$, we let $f_a(1/2^k) = a_k/2^k$, and then we “connect the dots” to complete the definition of $f_a$. We define $f_a(0) = 0$, because this is the only sensible thing to do. It is intuitively clear that the function $f_a$ so obtained is continuous, real-valued, and sends rationals of the form $1/2^k$, as well as $0$, to rationals. It also sends the rest of the rationals to rationals, due more or less to the fact that any polynomial with rational coefficients does so (so in particular, lines do so).

The set of binary sequences is obviously uncountable, and we have just injected them into $S$. Done.

Remarks. One’s first attempt might be to use rational-coefficient polynomials, but unfortunately they are countable. A different question is whether the word “continuous” in the problem could be replaced with more stringent requirements: $\mathcal{C}^k$ ($1 \leq k \leq \infty$). I feel like the answer is probably “yes” for any finite $k$ but perhaps “no” for $k=\infty$