TITLE: Elementary(?) measure theory.
QUESTION [5 upvotes]: A student complained that he was stuck on an exercise:


Suppose $(f_n)$ is a sequence of measurable functions on some measurable space. The set of $x$ such that $\lim_nf_n(x)$ exists is measurable.


I started to talk about the standard solution, and he objected that no, the $f_n$ took values in an arbitrary topological space.
I assured him that in a context like this a "measurable function" was at worst complex-valued. But, regardless of the author's intent, what about the case where the $f_n$ take values in a topological  space? My conjecture is that it must be false in that generality, simplyy because there's no way "there  exists $y\in Y$ with  $\lim  f_n(x)=y$" is going to lead to a countable union. But thinking about it off and on for a few days I don't see a counterexample.

REPLY [3 votes]: This is just a more detailed version of the accepted answer - Niels should get the smartness credit.


If $V$ is a dense subset of $\Bbb R$ there exists a sequence of monotone functions $f_n:\Bbb R\to\Bbb R$ with $f_n(\Bbb R)\subset V$ and $\lim f_n(x)=x$ for all $x$.


Proof: For $j\in\Bbb Z$ and $n\in\Bbb N$ define $$I_{n,j}=[j/n,(j+1)/n).$$Choose $v_{n,j}\in V\cap I_{n,j}$ and let $$f_n=\sum_{j\in\Bbb Z}v_{n,j}\chi_{I_{n,j}}.$$
It's clear that $f_n$ is monotone, since $v_{n,j}<v_{n.j+1}$. And it's clear that $|f_n(x)-x|<1/n$, since $|x-v_{n,j}|<1/n$ for $x\in I_{n,j}$. qed.
How this solves the problem: Say $E\subset\Bbb R$ is non-measurable and nowhere dense. Let $V=\Bbb R\setminus E$. Construct $f_n$ as above, except regard $f_n$ as a map from $\Bbb R$ to $V$ (with the subspace topology). Then $f_n$ is measurable, since the inverse image of any interval is an interval. And the set of $x$ such that $\lim f_n(x)$ exists (in $V$) is exactly $V$, a non-measurable set.
(I was that close - was stuck on getting $f_n:\Bbb R\to V$ measurable. Cuz I was thinking of measurable as a limit of continuous. Instead just make $f_n$ monotone, done.)