Let $f_n:[0,1]\rightarrow \mathbb R$ be a sequence of continuous functions converging pointwise, i.e. such that $\forall x\in [0,1]$, the sequence $(f_n(x))_{n\in \mathbb N}$ converges. We set $f(x)=\lim_nf_n(x)$.

Of course the function $f$ will fail in general to be continuous, due to the weakness of the pointwise convergence. I guess that it is possible to find an example of a sequence $f_n$ as above such that $f$ is discontinuous on a dense subset: is there a simple example? Is it possible for $f$ to be discontinuous everywhere?

Classical Descriptive Set Theory(Springer GTM 156), §24.B. One characterization is that $f\colon\mathbb{R}\to\mathbb{R}$ is pointwise limit of continuous functions iff $f^{-1}(U)$ is a countable union of closed sets for every open set $U$ (op. cit., 24.10). Its set of continuous points is then a comeager (hence dense) $G_\delta$ (op. cit., 24.14). $\endgroup$