$f\in L^2[0,1]$ iff $f\in L^1[0,1]$ and there is nondecreasing $g$ with $|\int_a^b f(x)dx|^2 \leq (g(b)-g(a))(b-a)$ for $0\leq a\leq b\leq 1$ Let $f:[0,1]\to \Bbb C$ be measurable. I am trying to show that $f\in L^2$ iff $f\in L^1$ and there is a nondecreasing function $g:[0,1]\to \Bbb R$ such that $$ \left\lvert \int_a^b f(x)~dx \right\rvert^2 \leq (g(b)-g(a))(b-a)$$
for $0\leq a\leq b\leq 1$. One implication is easy: we just let $g(x)=\int_0^x |f(t)|^2~dt$ and apply Holder's inequality. But I can't show the other implication. Any hints?

Divide both sides of the inequality by $(b-a)^2$:
$$\left(\frac{1}{b-a}\int_a^b f\right)^2\leq \frac{g(b)-g(a)}{b-a}. $$
Since $g$ is non-decreasing, it is almost everywhere differentiable, so taking the limit $b\to a$ we get by Lebesgue's differentiation theorem
$$ f(a)^2\leq g'(a),\qquad \text{a.e. } a\in [0,1].$$
Integrating over $[0,1]$ and since the fundamental theorem of calculus holds as inequality for non-decreasing functions (see e.g. Theorem 4 here),
$$\int_0^1 f(a)^2 \,\mathrm{d}a\leq \int_0^1 g'(a)\,\mathrm{d}a \leq g(1)-g(0)<\infty. $$
Hence, $f\in L^2(0,1)$.
