Not every function on $[0,1]$ is a pointwise limit of continuous functions on $[0,1]$

EDIT: As a consequence of reading the question too quickly, everything I've written below is about functions $\mathbb{R}\rightarrow\mathbb{R}$, not $[0, 1]\rightarrow\mathbb{R}$ - as an exercise, show that this doesn't affect anything.


Easiest (if least illuminating) way: count them.

There are $2^{2^{\aleph_0}}$-many functions from $\mathbb{R}$ to $\mathbb{R}$, but only $2^{\aleph_0}$-many of those are continuous (exercise - as well as the worst proof imaginable that there exist discontinuous functions). And the number of sequences of continuous functions is no bigger: $(2^{\aleph_0})^{\aleph_0}=2^{\aleph_0}$.

Note that this proves a stronger result: the Baire hierarchy is the hierarchy of functions you get by starting with the continuous functions and iteratively taking pointwise limits. Baire class 1 is continuous, and for $\alpha>1$, Baire class $\alpha$ is the set of functions which are the limit of a sequence of functions each individually in some $<\alpha$-level of the Baire hierarchy. The Baire hierarchy goes on for $\omega_1$-many levels, and then you stop getting any new functions. The counting argument shows that there are functions which are not Baire class $\alpha$, for any fixed countable $\alpha$. And, if the continuum hypothesis fails - that is, if $2^{\aleph_0}>\aleph_1$ - then this argument shows there are functions which aren't in any level of the Baire hierarchy!

(By the way, there's a similar hierarchy, the Borel hierarchy, and everything I've written about the Baire hierarchy holds of the Borel hierarchy too.)

We can actually show that there are some functions not in the Baire hierarchy, without any assumptions on cardinal arithmetic. But this is a bit more complicated. It goes as follows:

  • Fix a bijection $f$ from $\omega_1\times\mathbb{R}$ to $\mathbb{R}$. Basically, to each countable ordinal $\alpha$, $f$ associates continuum-many reals.

  • Separately, for each $\alpha\in\omega_1$, fix a bijection $g_\alpha$ between $\mathbb{R}$ and the set of functions of Baire class $\alpha$. (Such a bijection exists, by the argument above; this uses transfinite induction.)

  • Now we combine these! Let $\mathbb{B}$ be the set of all functions in the Baire hierarchy. We can get a function $h:\mathbb{R}\rightarrow \mathbb{B}$ as follows: given $r$, let $f^{-1}(r)=(\alpha, s)$ - we let $h(r)$ be $g_\alpha(s)$.

  • At this point, check that $h$ is in fact a surjection from $\mathbb{R}$ to $\mathbb{B}$.

  • And now we diagonalize! Let $F(r)=h(r)(r)+1$. Then $F\not\in\mathbb{B}$. Done!


Note that this can be made explicit: there are lots of easily-describable (if a bit messy) bijections between $\mathbb{R}$ and the set of continuous functions. And there are also lots of reasonbly natural injections of $\mathbb{R}^\omega$ and $\mathbb{R}$. Combining these, we get an explicit bijection $\beta$ from $\mathbb{R}$ to the set $\mathcal{S}$ of sequences of continuous functions. Now, we can use this to define a function $F$ which is not a pointwise limit of continuous functions as follows. If $r$ is a real, we let $F(r)$ be

  • $1+\lim_{n\rightarrow\infty} \beta(r)(n)(r)$, if that limit exists, and

  • $0$, if that limit doesn't exist.

This $F$ has a perfectly explicit, if annoyingly messy, definition. And it diagonalizes against the sequences of continuous functions, so it's not Baire class 2. Similarly, we can find explicit-if-messy functions not in Baire class $\alpha$, for any fixed countable $\alpha$. Where this breaks down is in trying to get a function which isn't in the Baire hierarchy at all: it is consistent with ZF that every function is in the Baire hierarchy (this involves killing choice to a stupidly extreme degree, however - $\omega_1$ winds up being a countable union of countable sets!).