Cardinality of this set: $A=\{f: \mathbb{R} \rightarrow \mathbb{R} \text{ continuous} : f(\mathbb{Q})\subseteq\mathbb{Q}\}$ How can I show that the cardinality of this set: $A=\{f: \mathbb{R} \rightarrow \mathbb{R} \text{  continuous} : f(\mathbb{Q})\subseteq\mathbb{Q}\}$ is $2^{\aleph_{0}}$?
I know that $A\subseteq \{f: \mathbb{R} \rightarrow \mathbb{R} \text{  continuous} \}$ so #$(A)\leq2^{\aleph_{0}}.$ But I don't know how to show the other inequality. Thanks a lot for your help! I know there is a post with the same question, but I don't understand the answer :(
Cardinality of $A=\{f: \mathbb R \to \mathbb R , f \text{ is continuous and} f(\mathbb Q) \subset \mathbb Q\}$
 A: Idea: we construct , on each interval $[n,n+1]$ , a countably-infinite collection of linear functions (linear functions $ax+b$ , with both a,b in $\mathbb Q$) mapping $\mathbb Q$ to itself, that extend to continuous functions $f: \mathbb R \rightarrow \mathbb R$. Linear functions extend because they are uniformly-continuous on a dense subset, and uniform continuity is sufficient to extend a function from a dense subset into the whole space. Then we extend each of these functions from $[n,n+1]$ to $[n+1,n+2]$ continuously. Then, each of the $|\mathbb Q|$ functions on $[n,n+1]$ can be (linearly)extended to $[n+1,n+2]$ in $|\mathbb Q|$ ways, so that the total cardinality is $|\mathbb Q| \times |\mathbb Q| \times....$ $|\mathbb Q|$  times.
Consider the integers $ \mathbb Z$ . We construct an uncountable collection of linear maps from $\mathbb Q $ to $\mathbb Q$, and we use the fact that linear maps, being uniformly-continuous on the dense subset $\mathbb Q$ of $\mathbb R$, extend to a continuous map $f: \mathbb R \rightarrow \mathbb R$  .Start at, say $0$. Then, following the idea of the link, any line thru the point $0$ with rational slope maps $\mathbb Q$ to $\mathbb Q$: take $px+q$ , with $p,q$ both in $\mathbb Q$, since Rationals are closed under multiplication, then  $px$ is Rational as a product of Rationals, and when we add $b$ to it we have a sum of Rationals, which is Rational. Notice this choice of line can be made in $|\mathbb Q|= \aleph_0$ ways . Now, extend the function at $x=1$ , starting at the image $a(1)+b$ , and then extend the same way from $x=2 $  to $x=3$ , i.e., you defined $a'x+b'$ in $[1,2]$ to be $a'x+b'$ , with both $a',b'$ Rational. This means that each of the $|\mathbb Q|$ choices in each of the interval $[n,n+1]$ can be combined with $\mathbb Q$ choices in $[n+1, n+2]$ , for all integers $n$. So you have a total of $|\mathbb Q|\times |\mathbb Q |\times...|.....$ , all of this $|\mathbb Q|$ times, which gives you an uncountable collection of functions $f: \mathbb Q \rightarrow \mathbb Q$ , that extend to continuous functions $F: \mathbb R \rightarrow \mathbb R$, and you're done.
A: Define $T(x) = \max\{0,1-|2x|\}$, so that $T(x)$ is a continuous "tent function" supported on the interval $({-}\frac12,\frac12)$. For any subset $S\subseteq\mathbb Z$ of the integers, the function
$$
F_S(x) = \sum_{n\in S} T(x-n)
$$
is a continuous function with a "tent" of width $1$ at every integer in $S$ and flat everywhere else. There are $2^{\aleph_0}$ subsets $S$ of $\mathbb Z$, hence $2^{\aleph_0}$ such continuous functions (they're all different, by checking their values on integers); and they all map rational numbers to rational numbers.
