Consider the interval $[0,1]$ and define $$ X_1:= \left[0, \frac{1}{2}\right], ~~~X_2 := \left[\frac{1}{2}, \frac{3}{4}\right], ~~ X_3 := \left[\frac{3}{4}, \frac{7}{8}\right], ...$$
Define a piecewise constant function as follow : $$ f(x) := \frac{1}{\sqrt{\mu(X_n)}\cdot n}$$ for $x \in X_n$. It seems to me that $f \in L_2[0,1]$ with respect to Lebesgue measure but $f \not\in L_1[0,1]$.
However, this can't be since $[0,1]$ is a finite measured space. Therefore we should have the following inclusion $L_1[0,1] \supseteq L_2[0,1]$. What am I getting wrong here ?
I had the idea of such a function while thinking about the inclusion $\ell_1 \subset \ell_2$. Since $\frac{1}{n} \in \ell_2 \backslash \ell_1$, I thought of adding trying to create a piecewise constant function taking values on this sequence (adding what seems to be appropriate weight) to see what's going on. But I ended up getting quite confused. Please illuminate me.