$f$ convex, $g$ concave and increasing, $\int_0^1 f = \int_0^1 g$, then $\int_0^1(f)^2 \geq \int_0^1(g)^2$ 
Let $f,g:[0,1] \to [0, \infty)$ be two continuous functions such that $$f(0) = g(0) = 0,$$ $f$ is convex, $g$ is concave and increasing and $$\displaystyle \int_0^1f(x)dx = \int_0^1g(x)dx.$$ Prove that $$ \displaystyle \int_0^1\left(f(x) \right)^2dx \geq \int_0^1\left(g(x) \right)^2dx.$$

I don't quite know how to approach the problem. 
I thought about using Chebyshev's inequality due to the fact that $g$ is increasing, $F(x) = \int_0^xf(t)dt$ is increasing (since $f$ is convex) and $G(x) = \int_0^xg(t)dt$ is increasing (since $g$ is increasing and $g(0) = 0$), but it didn't help me. 
I also tried to obtain something by writing the convexity and concavity point-wise and using the fact that $\displaystyle h(x) = \frac{f(x)}{x}$ is increasing and $p(x) = \displaystyle \frac{g(x)}{x}$ is decreasing, but I got nothing.
 A: It will be easy to answer the following question first: Assume that $f(x)$ is convex, $f(0)=0$, $f(x)\geq 0$ and $\int_{0}^{1}f(x)dx=M>0$ is fixed. Which function makes the integral 
$$
\int_{0}^{1}f(x)^{2}dx
$$
as small as possible? We will prove that linear function is the optimizer, i.e. $f(x) = kx = 2Mx$ gives the answer. To prove this, we need a lemma:
Lemma. Let $f:[0, 1]\to [0, \infty)$ be a convex continuous function with $f(0)=0$. Then we have
$$
\int_{0}^{1}xf(x)dx\geq \frac{2}{3}\int_{0}^{1}f(x)dx
$$
This is actually a contest problem I saw before. We will show this later. 
Assume that the lemma holds. Then we have
$$
0\leq \int_{0}^{1}(f(x)-2Mx)^{2}dx = \int_{0}^{1}f(x)^{2} -4M\int_{0}^{1}xf(x)dx + \frac{4}{3}M^{2} \leq \int_{0}^{1}f(x)^{2}dx - \frac{4}{3}M^{2}
$$
so $\int_{0}^{1}f(x)^{2}dx \geq \frac{4}{3}M^{2}$, where the equality holds for $f(x)=2Mx$. Similarly, the reversed inequality holds for the concave function $g(x)$ with same condition, so we get 
$$
\int_{0}^{1}f(x)^{2}dx \geq \frac{4}{3}M^{2} \geq \int_{0}^{1}g(x)^{2}dx.
$$

Proof of Lemma. Since $f(x)$ is convex, we have $$\int_{0}^{x}f(t)dt \leq \frac{1}{2}xf(x)$$ for any $x$. (Consider the triangle with vertices $(0, 0), (x, 0), (x, f(x))$.) Then
\begin{align*}
\frac{1}{2}\int_{0}^{1}xf(x)dx &\geq \int_{0}^{1}\int_{0}^{x}f(t)dtdx \\
&=\int_{0}^{1}\int_{t}^{1}f(t)dxdt \,\,\quad(\text{Fubini's theorem})\\
&=\int_{0}^{1}(1-t)f(t)dt \\
&= \int_{0}^{1}f(x)dx - \int_{0}^{1}xf(x)dx
\end{align*}
and we get the inequality. 
A: For some $0 < \epsilon < 1$,
$$
\int_\epsilon^1 (f(x)^2-g(x)^2)dx = \int_\epsilon^1 (f(x) + g(x))(f(x)-g(x)) dx
$$
since $f(x)+g(x) \ge 0$, we can apply the intermediate value theorem to get a $\xi \in [\epsilon,1]$, such that
$$
\int_\epsilon^1 (f(x) + g(x))(f(x)-g(x))dx = (f(\xi)+g(\xi))\int_\epsilon^1 (f(x)-g(x))dx \,.
$$
Since $f(\xi)+g(\xi) \ge 0$, it remains to show that 
$$
\int_\epsilon^1 (f(x)-g(x))dx \ge 0
$$
$h(x) = (f(x)-g(x))$ is also convex ($-g(x)$ is convex) with ($h(0) = 0$), so $h$ can only have at most 2 roots (except $h \equiv 0$). If there is no other root $x_0 \in(0,1)$, then either $f(x) > g(x)$ or the other way around, and the integrals would not match. So there must be $x_0 \in(0,1)$ such that $h(x) \ge 0$ for all $x \ge x_0$. Therefore $f(x) \ge g(x)$ and furthermore $\int_\epsilon^1(f(x)-g(x))dx \ge 0$, with $\epsilon := x_0$.
