# $f_n \to f$ a.e. and $g$ continuous at $f(x)$ for a.e. $x$, then $g\circ f_n \to g \circ f$ a.e.

Okay, this is a question from Cohn (3.1 exercise 3). I think I solved it, but I didn't use two major hypotheses.

Here is the question:

Let $(X, \mathscr{A}, \mu)$ be a measure space, and let $f$ and $f_1,f_2,\ldots$ be real-valued $\mathscr{A}$ measurable functions on $X$, and let $g: \mathbb{R} \to \mathbb{R}$ be Borel measurable. Show that if $\{f_n\}$ converges to $f$ almost everywhere, and if $g$ is continuous at $f(x)$ for almost every $x$, then $\{g \circ f_n\}$ converges to $g \circ f$ almost everywhere.

Here is what I have come up with. Since $f_n \to f$ a.e. we may choose $N_1$ with $\mu(N_1)=0$ containing all the points with $f_n(x)\not\to f(x)$. Similarly, choose $N_2$ with $\mu(N_2)=0$ containing all the points where $g$ is not continuous at $f(x)$.

Then $\mu(N_1 \cup N_2) = 0$. Let $x \notin N_1 \cup N_2$ be given. Then since $x \notin N_1$ we have $f_n(x) \to f(x)$. Furthermore, since $x \notin N_2$ we have that $g$ is continuous at $f(x)$, so since $\{f_n(x)\}$ is a sequence converging to $f(x)$ we have $$\lim_{n \to \infty}(g \circ f_n)(x)=\lim_{n \to \infty}g(f_n(x)) = g(\lim_{n \to \infty} f_n(x)) = g(f(x)) = (g\circ f)(x).$$ So $g \circ f_n \to g \circ f$ except possibly on the measure zero set $N_1 \cup N_2$, i.e. almost everywhere. QED.

But I didn't use the fact that any of the $\{f_n\}$ are measurable, nor the fact that $g$ is Borel measurable. Where have I gone wrong?

-

However, these are usual hypotheses in this context (already in the definition of '$f_n\to f$ almost everywhere' is usually involved that these functions are measurable, though, makes sense even without this).