# Prove that $S = \{ f: [0,1]\rightarrow \mathbb{R} \ \text{continuous} : x\in\mathbb{Q}\implies f(x) \in \mathbb{Q}\}$ is. uncountable

Prove that $$S = \{ f: [0,1]\rightarrow \mathbb{R} \ \text{continuous} : x\in\mathbb{Q}\implies f(x) \in \mathbb{Q}\}$$ is uncountable.

I know that reals are uncountable, so I look for injection from reals to set $$S$$, i.e., if we can define a function as above for each real number, then we are done. Am I going in the right direction? Please help with some hint/solution.

Let $$X$$ be the set of all sequences r = $$\{r_n \}_1^{\infty}$$ such that $$r_n=\{ 1,-1\}$$ it is an uncountable !!

For $$r$$ in $$X$$ let $$f_r$$ be function defined on [0, 1] such that

• $$f_r (0) =0$$

• $$f_r(1/n) = r_n / n$$ for n positive integer ;

• on each interval $$[ 1/(n+1), 1/n] , f_r$$ is linear function whose values at the endpoints agree with those given by (2)

Each function $$f_r$$ is continuous at point of $$(0, 1]$$ is obvious, and continuity at $$0$$ follows because $$|f(x) | \leq x$$

Each $$f_r$$ takes rational values at rational points :

if $$x$$ is rational point between $$a=1/(n+1)$$ and $$b = 1/n$$ , then

$$x= (1-t) a+tb$$ with $$t$$ a rational points of [0, 1] , so

$$f_r(x)= (1-t) f_r (a) + tf_r(b)$$ is rational because $$f_r( a)$$ and $$f_r(b)$$ are.

The functions $$f_r$$ thus form an uncountable subset of S, showing that S is uncountable

• Thankyou for detailed answer , Oct 17, 2020 at 3:35
• Your 3rd "bullet" refers to (2) but I don't see what (2) is. Oct 17, 2020 at 5:35
• it refers to 2nd bullet
– ਮੈਥ
Oct 17, 2020 at 6:31

I would probably start with the uncountable set of all increasing sequences of integers and assign $$f(1/n) = 1/a_n$$ for a sequence $$a_n$$.

Extend this step-wise linearly; it should map $$\mathbb{Q}$$ to $$\mathbb{Q}$$.

Given a real number $$a\in [0,1]$$ with decimal expansion $$a=0.a_1a_2a_3a_4...$$ consider the piecewise linear function defined by $$f\left(\frac{1}{i}\right) = a_i/i \in S$$.

This gives you an injection of the uncountable set $$[0,1]$$ in $$S$$, therefore $$S$$ also uncountable.

EDIT: Thanks for the commenters pointing out that the function needs to be continuous at $$0$$ as well.

• How do you define $f$ at $0$ so that the function is continuous? Oct 15, 2020 at 9:55
• There is a small problem about the decimal expansion not being unique.. Oct 15, 2020 at 10:02
• Come on, I am sure we can fix this answer. :-( Oct 15, 2020 at 10:03

HINT:

For every $$a\in \{0,1\}^{\mathbb{N}}$$ consider $$f_a(\frac{1}{n}) = \frac{1}{2n + a_n}$$, $$1\mapsto 1$$, $$0\mapsto 0$$, and extend by linearity.

• Your function maps the interval 0 to 1 into the interval 0 to 1/2
– Kosh
Oct 15, 2020 at 10:23
• @Kosh: typo corrected, thanks Oct 15, 2020 at 10:32
1. For any real function $$f,$$ if $$a,b,f(a),f(b)\in \Bbb Q$$ and $$f$$ is linear on $$[a,b]$$ then $$\{f(x):x\in \Bbb Q\cap [a,b]\}\subset \Bbb Q.$$

2. Let $$T$$ be the set of strictly increasing sequences of $$positive$$ rationals that converge to $$1$$. Then $$T$$ is uncountable. Because (by a typical diagonal method) if $$A=\{(q_{n,j})_{n\in \Bbb N}: j\in \Bbb N\}\subset T,$$ then let $$r_1\in \Bbb Q\cap (q_{1,1},1)$$ and for $$n\in \Bbb N$$ let $$r_{n+1}\in \Bbb Q\cap (\max (r_n,q_{n+1,n+1}),1).$$ Then $$(r_n)_{n\in \Bbb N}\in T$$ \ $$A.$$

3. For $$t=(q_n)_{n\in \Bbb N}\in T$$ and $$n\in \Bbb N$$ let $$f_t(1-2^{-n})=q_n$$ and let $$f_t$$ be linear on $$[1-2^{-n}, 1-2^{-n-1}].$$ Let $$f_t(0)=0$$ and let $$f_t$$ be linear on $$[0,1/2].$$ And let $$f_t(1)=1.$$ Then $$\{f_t:t\in T\}$$ is an uncountable subset of $$X.$$

• To be pedantically rigorous, in 2. I should have noted that $T\ne \emptyset.$ Oct 17, 2020 at 5:39