Definition of measurable set: A set $E$ measurable if $$m^*(A) = m^*(A \bigcap E) + m^*(A \bigcap E^c)$$ for every subset of $A$ of $\mathbb R^n$.
Definition of Lebesgue measurable function: Given a function $f: D \to \mathbb R ∪ \{+\infty, -\infty\}$, defined on some domain $D \subset \mathbb{R}^n$, we say that $f$ is Lebesgue measurable if $D$ is measurable and if, for each $a\in[-\infty, +\infty]$, the set $\{x\in D \mid f(x) > a\}$ is measurable.
Definition of almost everywhere convergence: Suppose $f(x), f_1(x), f_2(x), \dots, f_k(x), \dots$ are extended real functions defined on a set $E \subset \mathbb R^n$ that is each $f_i: E \to [-\infty, +\infty] $. If $\exists Z \subset E$ such that $m(Z)=0$ and $$\lim_{k \to +\infty}f_k(x) = f(x), x\in(E-Z),$$ then $\{f_k(x)\}$ converges almost everywhere to $f(x)$ on $E$, namely $$f_k(x) \to f(x),\ \text{a.e.}\ x ∈ E.$$
I think I can translate "$f_k(x) \to f(x),\ \text{a.e.}\ x \in E$" into an exact math symbol that should be $m(\{x\in E \mid(\lim_{k\to+\infty}f_k(x)) \neq f(x)\}) = 0$. However, I'm not sure whether the "$\lim$" can be taken out of the set that is
$$m\left(\lim\limits_{k\to+\infty}\{x\in E \mid f_k(x) \neq f(x)\}\right)=0?$$
I have two hurdles ahead, one is $\left\{x\in E \mid \lim\limits_{k\to+\infty}f_k(x) \neq f(x)\right\}$ may not be equal to $\lim\limits_{k\to+\infty} \{x\in E \mid f_k(x) \neq f(x)\}$ and the other is $\lim\limits_{k\to+\infty} \{x\in E \mid f_k(x) \neq f(x)\}$ may not exist.
I tried an example on the domain $[0, 1]$: $f_k(x) = x^k$ and $f(x) = 0$. I have $f_k(x) \to f(x),\ \text{a.e.}\ x \in [0,1]$ is equivalent to
\begin{align*} \left\{x\in[0,1] \mid \lim\limits_{k\to+\infty}f_k(x) \neq f(x)\right\} &= \{1\}\\ &\neq \lim\limits_{k\to+\infty} \{x\in [0,1] \mid f_k(x) \neq f(x)\}\\ &= \lim\limits_{k\to+\infty}(0,1]\\ &= (0,1] \end{align*}
and $m(\{1\}) \neq m((0,1])$. Even,
\begin{align*} m\left(\left\{x\in[0,1] \mid \lim\limits_{k\to+\infty}f_k(x) \neq f(x)\right\}\right) &= m(\{1\})\\ &= 0\\ &\neq \lim_{k\to+\infty} m(\{x\in [0,1] \mid f_k(x) \neq f(x)\})\\ &= \lim_{k\to+\infty}m((0,1])\\ &= 1\\ &= m\left(\lim\limits_{k\to+\infty} \{x\in [0,1] \mid f_k(x) \neq f(x)\}\right). \end{align*}
So from this example, I know
$$m\left(\left\{x\in [0,1] \mid \lim\limits_{k\to+\infty}f_k(x) \neq f(x)\right\}\right) \neq \lim\limits_{k\to+\infty} m(\{x\in[0,1] \mid f_k(x) \neq f(x)\})$$
and
$$m\left(\left\{x\in [0,1] \mid \lim\limits_{k\to+\infty}f_k(x) \neq f(x)\right\}\right) \neq m\left(\lim\limits_{k\to+\infty} \{x\in [0,1] \mid f_k(x) \neq f(x)\}\right).$$
But if I replace $\lim\limits_{k\to+\infty} \{x\in [0,1] \mid f_k(x) \neq f(x)\}$ with
$$E(n,k) = \bigcup_{m=n}^{\infty}\left\{x\in [0,1] : |f_m(x) - f(x)| \geq \frac{1}{k}\right\}$$
where $k\in\mathbb N^+$, then
$$m(E(n,k)) = m\left(\bigcup_{m=n}^{\infty}\left[\left(\frac{1}{k}\right)^{\frac{1}{m}}, 1\right]\right) =m\left(\left[\left(\frac{1}{k}\right)^{\frac{1}{n}}, 1\right]\right) \to 0$$
as $n\to+\infty$ for each $k$.
What happened here? Why does exchanging order of $\lim$ and measure will cause such a big difference? And why can union operation keep the measure the set have? Or is there something wrong with my idea or example?
$\{x:\lim f_k(x)\ne f(x)\}$ simply has nothing to do with the limit of the sets $\{x:f_k(x)\ne f(x)\}$. For example let $f_k(x)=1/k$ for all $k$. Why doesn't this have anything to do with that? Well, it doesn't - you don't have any good reason to think it does.