TITLE: Cardinality of set of real continuous functions
QUESTION [84 upvotes]: I believe that the set of all $\mathbb{R\to R}$ continuous functions is $\mathfrak c$, the cardinality of the continuum. However, I read in the book "Metric spaces" by Ó Searcóid that set of all $[0, 1]\to\mathbb{R}$ continuous functions is greater than $\mathfrak c$:

"It is demonstrated in many textbooks that $\mathbb{Q}$
is countable, that $\mathbb{R}$ is uncountable, that every non-degenerate interval is uncountable, that the collection of continuous functions deﬁned on  $[0,1]$ is of a greater cardinality than $\mathbb{R}$, and that there are sets of greater and greater cardinality."

I understand that (via composition with the continuous function $\tan$ or $\arctan$) these sets of continuous functions have the same cardinality. Therefore, which claim is correct, and how do I prove this?

REPLY [5 votes]: On the one hand it is clear that the set of all the continuous functions from $\mathbb{R}$ to $\mathbb{R}$, which shall be denoted by $\mathcal{C}^0$, is such that:
$$|\mathbb{R}|\le|\mathcal{C}^0|$$
(because for each $r\in \mathbb{R}$, simply we consider the constant function $f_r:\mathbb{R}\longrightarrow\mathbb{R}$ defined by: for each $x\in \mathbb{R},\;f_r(x)=r$. Obviously, the assignation $r\longmapsto f_r$ is injective).
On the other hand, we know that $\mathbb{R}$ is a Hausdorff space, so if $f,g\in\mathcal{C}^0$ are two continuous functions such that they agree in the (dense) subset of the rational numbers, then $f=g$ (cf Stephen Willard, General Topology, 1970, Addison Wesley, page 89, 13.14).
This allows us to consider the function $F:\mathcal{C}^0\longrightarrow ^\mathbb{Q}\mathbb{R}$ defined by: for each $f\in\mathcal{C}^0,\;F(f)=f|_\mathbb{Q}$ (where $^\mathbb{Q}\mathbb{R}$ denotes the set of all the functions from $\mathbb{Q}$ to $\mathbb{R}$).
From the previous comment, it is clear that $F$ is then an injective function, therefore:
$$|\mathcal{C}^0|\le|^\mathbb{Q}\mathbb{R}|={\big(2^{\aleph_0}\big)}^{\aleph_0}=2^{\aleph_0\times\aleph_0}=2^{\aleph_0}=|\mathbb{R}|$$
From the Cantor-Bernstein theorem we conclude that $|\mathcal{C}^0|=|\mathbb{R}|$.