Show that $\lim_n f_n(x) = f(x)$ almost surely for an integrable function 
An exercise taken from Klenke: Let $f \in L^1(\lambda)$, where $\lambda$ is the restriction of the Lebesgue measure to $[0,1]$. Let $I_{n,k} = [k2^{-n},(k+1)2^{-n}), $ for $n \in \mathbb{N}$ and $k = 0,...,2^{n}-1$. Define $f_n:[0,1]\to \mathbb{R}$ by
$$ f_n(x)=2^n\int_{I_{k,n}} f d\lambda$$ if k is chosen such that $x \in I_{k,n}$. Show that $\lim_{n\to \infty} f_n(x) = f(x)$ almost surely for $x \in [0,1]$.

But I'm not sure about here $$\lim_n f_n(x) = \lim_n 2^n\int_{k2^{-n}}^{(k+1)2^{-n}} f d\lambda...$$
since $\lim 2^n=0$? If we remove it then perhaps it makes sense below:
i.e. Say $\int_0^1f(x) dx=\int_{I_{k,n}}f \mathop{}\!d \lambda $, therefore
$$
\lim_{n \to \infty}\int_0 ^1f(x) dx=\lim_{n \to \infty}\int_{I_{k,n}}f \mathop{}\!d \lambda \tag1
$$
Now as $\{I_{k,n}f\}$ is a family of non-negative functions, then the monotone convergence theorem yields
$$
\int_{[0,1]} f\mathop{}\!d \lambda =\lim_{n \to \infty}\int_{I_{k,n}}f \mathop{}\!d \lambda \tag2
$$
Then from $(1)$ and $(2)$ we have that
$$
\int_{[0,1]} f\mathop{}\!d \lambda =\lim_{n \to \infty}\int_{k2^{-n}}^{(k+1)2^{-n}}f(x) \mathop{}\!d x\tag3
$$
So $f\in L^1$ if and only if $\lim_{n\to \infty}\int_{k2^{-n}}^{(k+1)2^{-n}}f(x) \mathop{}\!d x$ converges.
 A: First, $\lim_n2^n=\infty$. If you remove it, the limit of the integrals is zero. The point of the $2^n$ at the front is that it is $1/\lambda(I_{k,n})$.
Assume first that $f$ is continuous (so uniformly continuous). Given $\varepsilon>0$, there exists $\delta>0$ such that $|s-t|<\delta$ implies $|f(s)-f(t)|<\varepsilon$. So if $2^n>\tfrac1\delta$, then $|s-t|<\delta$ for all $s,t\in I_{k,n}$. Then
\begin{align}
|f(x)-f_n(x)|
&=2^n\Bigg|\int_{I_{k,n}}(f(x)-f(t))\,d\lambda(t)\Bigg|\\[0.3cm]
&\leq 2^n\,\int_{I_{k,n}}|f(x)-f(t)|\,d\lambda(t)\\[0.3cm]
&\leq2^n\varepsilon\,\lambda(I_{k,n})=\varepsilon. 
\end{align}
So $f_n(x)\to f(x)$ for all $x$.
Consider now a general $f\in L^1[0,1]$. Then there exists a sequence $\{g_n\}\subset L^1[0,1]$ with $\|g_n-f\|_1\to0$. From here we can choose a subsequence $\{g_{n_s}\}$ such that $g_{n_s} \to f$ almost uniformly.  Now
\begin{align}
|f(x)-f_n(x)|
&\leq |f(x)-g_{n_s}(x)|+\Big|g_{n_s}(x)-2^n\int_{I_{k,n}}g_{n_s}\Big|+\Big|2^n\int_{I_{k,n}}g_{n_s}-f_n(x)\Big|\\[0.3cm]
&\leq|f(x)-g_{n_s}(x)|+\Big|2^n\int_{I_{k,n}}(g_{n_s}(x)-g_{n_s})\Big|+\Big|2^n\int_{I_{k,n}}(g_{n_s}-f)\Big|.\\[0.3cm]
\end{align}
The three terms go to zero: the first and third by the almost uniform convergence, and the middle one by continuity of $g_{n_s}$.
