I would be glad if someone could help me to prove the following exercise.
Let $\{g_n\}$ be a sequence of measurable functions on $[0,1]$ such that
(a) There exists a constant $C>0$ such that for each $n\in \Bbb N$, $|g_n(x)|\leq C$ for almost all $x\in[0,1]$.
(b) For every $a\in [0,1]$, $\lim_{n\to\infty}\int_0^a g_n(x)dx=0$.
Prove that for each $f\in L^1([0,1])$ we have $\lim_{n \to\infty}\int_0^1 f(x)g_n(x)dx=0$.
Attempt. Suppose $f$ is a step function defined on $[0,1]$. We show that $\lim_{n \to\infty}\int_0^1 f(x)g_n(x)dx=0$. Say $f=\sum_{i=1}^N c_i\chi_{E_i}$ for some disjoint intervals $E_1,\dots,E_N\subseteq [0,1]$. Then
$$ \lim_{n \to\infty}\int_0^1 f(x)g_n(x)dx=\lim_{n\to\infty}\int_0^1 \left(\sum_{i=1}^N c_i\chi_{E_i}(x)\right) g_n(x)dx=\sum_{i=1}^Nc_i\int_{E_i}g_n(x)dx=0$$ since for each $n\in\Bbb N$ and $a,b\in [0,1]$ with $a\leq b$ we have $$\int_a^b g_n(x)dx=\int_0^b g_n(x)dx -\int_0^a g_n(x)dx \implies \lim_{n\to\infty}\int_a^bg_n(x)dx=0.$$
Question. Does there exist a sequence $\{f_n\}$ of step functions on $[0,1]$ such that $0\leq f_1\leq f_2\leq\dots$ and $f_n$ converges to $|f|$ pointwise almost everywhere on $[0,1]$?
Even if the answer is yes, I couldn't conclude the proof by monotone convergence theorem. Thanks!