TITLE: Existence of a pointwise convergent subsequence
QUESTION [11 upvotes]: Let $X$ be a compact metric space and $f_m:X\to[0,1]$ a continuous function for each $m\in\mathbb N$.

Does there necessarily exist a $f:X\to[0,1]$ (not necessarily continuous) and a subsequence $(f_{m_k})$ such that $f_{m_k}(x)\to f(x)$ for each $x\in X$ pointwise?

Note that the equicontinuity of $(f_m)_{m\in\mathbb N}$ is not assumed, so that the Arzelà–Ascoli theorem is of no use here. However, the desired conclusion is also weaker: the supposed limit function $f$ need not be continuous and only pointwise convergence is required.
Any suggestion would be appreciated.

REPLY [8 votes]: A similar example using more machinery hence  perhaps less tricky in the details: Let $X=[0,2\pi]$, $f_n(t)=\cos(nt)$.  If $f_{n_k}(x)\to f(x)$ for (almost) every $x$ then Dominated Convergence shows that $||f_{n_k}-f||_2\to0$; this is impossible by orthogonality (for example, $||f_n-f_m||_2^2=2\pi$.)