Let $(X,\Sigma,\mu)$ be a measure space and suppose $f_n\colon X\to\mathbb{R}$ is measurable for all $n\in\mathbb N$. It is well known that if $$\lim_{n\to\infty}f_n(x)$$ exists for all $x\in X$, then $$\left(\lim_{n\to\infty}f_n\right)(x):=\lim_{n\to\infty}f_n(x)$$ is a measurable function. But what if we only know that the limit exists almost everywhere? Note:
The set $N$ on which the limit does not exist is not necessarely measurable - at least according to the definition of "almost everywhere" from my lecture.$^1$
I am not asking whether the function $$\lim_{n\to\infty}f_n\colon X\setminus N\to\mathbb{R}$$ is measurable, but if the function \begin{align}\lim_{n\to\infty}f_n\colon X&\to\mathbb{R}\\x&\mapsto\begin{cases}\lim_{n\to\infty}f_n(x)&\text{if }x\in X\setminus N\\0&\text{else}\end{cases}\end{align} is measurable (or are these equivalent?).
$^1$ According to the definition from my lecture this only tells us that $$\inf\left\{\mu(A):N\subset A\text{ and }A\in\Sigma\right\}=0$$