Equivalent condition of $f$ to be $L^2$ Let $f$ be Lebesgue measurable function on $[0,1]$. Prove that $f\in L^2[0,1]$ iff $f\in L^1[0,1]$ and there is a monotone increasing function $g$ such that for all closed intervals $[a,b]\subset[0,1]$, $$\left| \int_{a}^b f(x)dx \right|^2 \le (g(b)-g(a))(b-a)$$

My attempt: Since $[0, 1]$ is a finite measure space, it is clear that $L^2\subset L^1$. But how should I prove that there is a monotone increasing function $g$ satisfying the above inequality? Also I have to prove the converse too, but I have no idea for proving the converse, either.

Any hints or advices will help a lot!
For the converse: You can approximate $f \in L^1$ in $L^1$-norm by functions of the form $\sum_{k=1}^n c_k 1_{[a_k,b_k)}$ with disjunct intervals $[a_k,b_k)$. This convergence is also uniformly in the total-variation norm, i.e. $|\int_a^b f_n \, \rm{d}x - \int_a^b f \, \rm{d}x| \rightarrow 0$ uniformly for all $0 \leq a &lt; b \leq 1$.

Now, use the given property for the intervals $[a_k,b_k)$, that is
$$c_k^2 = \left|\int_{a_k}^{b_k} f_n \rm{d} x \right|^2 \leq 2\varepsilon_k^2+2(b_k-a_k)(g(b_k)-g(a_k)),$$
where
$$\varepsilon_k := \int_{a_k}^{b_k} |f_n-f| \, \rm{d} x$$
and sum it
$$\int_0^1 f_n^2 \, \rm{d} x = \sum_{k=1}^n c_k^2 \leq 2\sum_{k=1}^n  \varepsilon_k^2+ 2\sum_{k=1}^n(b_k-a_k) (g(b_k)-g(a_k)) $$
Using a Telescoping Sum argument and the monotonicity of $g$, the last term can be bounded by $2(b-a) (g(b)-g(a))$. Since $\varepsilon_k \leq \int_0^1 |f-f_n| \, \rm{d} x$, we can choose $n \geq N$ such that $\varepsilon_k \leq 1$. Thus $\varepsilon_k^2 \leq \varepsilon_k$ and
$$\sum_{k=1}^n \varepsilon_k^2 \leq \sum_{k=1}^n \varepsilon_k \leq \int_0^1 |f-f_n| \, \rm{d} x.$$
Chosing a $\lambda$-a.s. convergent subsequence, one can apply the Fatou-Lemma in order to get
$$\int_0^1 f^2 \rm{d} x \leq 2(b-a)(g(b)-g(a))$$

$\Rightarrow$: To construct $g$ you may just use the Hölder-inequality:
$$\left| \int_a^b f(x) \, \rm{d} x \right|^2 \leq (b-a) \int_a^b f(x)^2 \, \rm{d} x,$$
i.e. one can define
$$g(y) := \int_0^x f(x)^2 \, \rm{d} x.$$
$f \in L^2[0,1] \Rightarrow f^2 &lt; \infty \text{ a.s.}$
then $f &lt; \infty \text{ a.s.}$ and
$$ \lvert f \rvert \leq 1_{\{f^2 \leq 1 \}} + f^2 $$

Hence
$$\int \lvert f \rvert \mathrm{d}\lambda \leq 1 + \int f^2 \mathrm{d}\lambda &lt; \infty,$$ i.e. $\lvert f \rvert \in L^1[0,1]$, then $f$ is also.

The converse is not true.
Take for example $$f = \sum\limits_{n=1}^{\infty}n^{1-\varepsilon} \cdot 1_{\left[\frac{1}{n+1}, \frac{1}{n}\right)} $$.

$f \in L^1[0,1]$, since the series $\sum\limits_{n=1}^{\infty}\frac{n^{-\varepsilon}}{n+1}$converges for all $\varepsilon$, but $f^2 \notin L^1 \Rightarrow f \notin L^2$.