# Cardinality of continuous functions on subspace of R^n

I know that the set of continuous functions on $R^n$ has cardinality of R. Can this be generalized to any subspace of $R^n$? It seems intuitive, but the empty set seems to be a counterexample of this claim. If the theorem is false, is there any way to salvage it?

-

If $\varnothing\ne X\subseteq\Bbb R^n$, there are $2^\omega=|\Bbb R|$ continuous real-valued functions on $X$. Clearly there are at least that many, since for every $r\in\Bbb R$ the constant function $f:X\to\Bbb R:x\mapsto r$ is continuous. Thus, we need only show that there are at most $2^\omega$ continuous functions on $X$.

$\Bbb R^n$ has a countable base for its topology, so it’s hereditarily separable, and therefore $X$ has a countable dense subset $D$. If $f,g:X\to\Bbb R$ are continuous, and $f\upharpoonright D=g\upharpoonright D$, then $f=g$. (This is a standard result, and you might like to try to prove it if you’ve not seen it before: the proof isn’t hard.) Thus, the number of continuous real-valued functions on $X$ is at most the number of real-valued functions on $D$. Since $D$ is countable, this is $|\Bbb R|^{|D|}\le\left(2^\omega\right)^\omega=2^\omega$: there are at most $2^\omega$ continuous real-valued functions on $X$.

Putting the pieces together, we see that there are precisely $2^\omega$ continuous real-valued functions on $X$.

Of course if you don’t specify the codomain of the functions, there are many more than $2^\omega$. As long as the codomain has cardinality $2^\omega=|\Bbb R|$, however, the result holds.

-
If the codomain has cardinality less than $\mid \mathbb{R} \mid$, wouldn't the cardinality of continuous functions on X be less than that of the continuum? For example, if X is a finite subset of $\mathbb{R}$ with the subspace topology, aren't there finitely many continuous functions from X to X? –  Erdong H. Oct 17 '12 at 6:40
@Erdong: I said nothing about the case in which the codomain has cardinality less than $2^\omega$. –  Brian M. Scott Oct 17 '12 at 6:43
Does the codomain need to be Hausdorff for us to conclude that $f = g$ from $f |_D = g |_D$? –  Zhen Lin Oct 17 '12 at 6:44
@ZhenLin: Yes, it does. –  Brian M. Scott Oct 17 '12 at 6:47
My question was a bit vague. I am primarily concerned with continuous functions with X as both the domain and codomain. I understand that finite and countable X are counterexamples, but is there a way for the theorem to be true with a looser criterion than the codomain having cardinality of the continuum? –  Erdong H. Oct 17 '12 at 6:48