Let $(X,\mathcal{A}, \mu)$ be a finite measure space and let $\{f_n\}$ be a sequence of real-valued measurable functions on $X$. Suppose that there is a constant $M$ such that $|f_n(x)| \leq M$ for all $n$ and $x \in X$. Suppose also that the sequence $f_n(x)$ converges almost everywhere to a function $f$. Show that $f$ is measurable and for each function $g \in L^2(X, \mu)$. $$\int fgd\mu=\lim_{n\to \infty}\int f_ngd\mu$$
can I have sth like a sketch of what should I do on rest of this problem?
Is the following enough to show that f is measurable? $$\forall \alpha \in \mathbb{R} , \lbrace x\in X:f(x)>\alpha \rbrace = \bigcup_{k\ge 1}\bigcup_{N\ge 1}\bigcap_{n\ge N}\bigg\lbrace x\in X: f_n(x)\ge \alpha + \frac{1}{k} \bigg\rbrace$$
Since $f_n \to f$ we also have that $|f(x)| \leq M$
so $f_n,f$ are integrable since we are in a finite measure space.
And $\int|f_n-f| \to 0$ by hypothesis and Dominated convergence.
Thus $$\left |\int f_ng-\int fg\right | \leq \int|g||f_n-f| \leq ||f_n-f||_2||g||_2 \to 0$$ by Cauchy-Schwartz
and from the fact that $||f_n-f||_2 \leq 2M||f_n-f||_1 \to 0$
For the measurability note that $f(x)=\limsup_nf_n(x)$ and we know that $\limsup_nf_n$ is always measurable if $f_n$ are.