# An example of a function $f$ for which there does not exist a sequence of continuous functions $f_n$ converging pointwise to $f$.

I am trying to find a function $f$ for which there does not exist a sequence of continuous functions $f_n$ converging pointwise to $f$.

I would be interested to see some examples. My first idea was the classic "very discontinuous functon" which is $0$ at each rational and $1$ at each irrational, but I believe it is possible to construct such a sequence $f_n$ because the rationals are countable. So I'm rather stuck. Maybe I need to find a subset of $\mathbb R$ which is dense, uncountable and not cocountable? In any case I would struggle to come up with a proof.

If $f$ is the pointwise limit of continuous functions, then $f$ has to be continuous in a dense $G_\delta$. (For a proof see Elementary Real Analysis by Thomson, Bruckner & Bruckner, page 587.)
Hence $$f(x)=\left\{ \begin{array}{lll} 1 & \text{if} & \text{x\,\, rational}, \\ 0 & \text{if} & \text{x\,\, irrational}, \end{array} \right.$$ can not be the pointwise limit of continuous functions, as $f$ is everywhere discontinuous.
• Yiorgos.I am familiar with with the statement if $f_n \rightarrow f$ uniformly, $f_n$ continuos , then $f$ continuos.Was not aware that pointwise convergence (only) is sufficient.Please comment. Thanks, Peter Commented Jun 1, 2018 at 8:19
• The pointwise limit is continuous only in a dense $G_\delta$. Not necessarily everywhere! Commented Jun 1, 2018 at 8:41