How to show $\int_{E} x \, d\mu \geq \mu(E)^2 / 2$ Let $E \subseteq [0,1]$, $\mu$ the Lebesgue measure.
I would like to show that $\int_{E} x \, d\mu \geq \frac{1}{2} \mu(E)^2$.

Lemma:
$$ \int_{0}^{\mu(E)} x \, d\mu \leq \int_{E} x \, d\mu $$

This lemma seems pretty reasonable, in fact, I would expect it to hold for any monotone function $f : [0, 1] \to \mathbb{R}$:
$$ \int_{0}^{\mu(E)} f \, d\mu \leq \int_{E} f \, d\mu $$
But I'm not sure how to prove it rigorously. If the lemma holds, the result follow as $\int_{0}^{\mu(E)} x \, d\mu = \frac{1}{2} \mu(E)^2$.
Idea of a proof:
\begin{align*}
\int_{0}^{1} 1_{E} f \, d\mu
&= \left[ f(x) \int_{0}^{x} 1_{E} \, d\mu \right]_{0}^{1}
- \int_{0}^{1} \left( \int_{0}^{x} 1_{E} \, d\mu \right) f'(x) \, d\mu(x) \\
&= f(1) \mu(E) - \int_{0}^{1} \left( \int_{0}^{x} 1_{E} \, d\mu \right) f'(x) \, d\mu(x) \\
&\geq f(1) \mu(E) - \int_{0}^{1} \left( \int_{0}^{x} 1_{[0, \mu(E)]} \, d\mu \right) f'(x) \, d\mu(x)  \\
&= \int_{0}^{1} 1_{[0, \mu(E)]} f \, d\mu
\end{align*}
Again, I'm not sure if integration by parts is valid in this context, and I'm pretty sure that $f$ needn't be differentiable for the lemma to hold.
 A: Here's an elementary solution. Note that
$$
\begin{aligned}
\frac 12 \mu(E)^2 
&= \int x1_{[0,\mu(E)]}(x) d\mu(x)\\
&= \int x1_{[0,\mu(E)]\cap E}(x) d\mu(x) + \int x1_{[0,\mu(E)]\cap E^c}(x) d\mu(x)\\
&= \int x1_{E}(x) d\mu(x)-  \int x1_{[0,\mu(E)]^c\cap E}(x) d\mu(x) + \int x1_{[0,\mu(E)]\cap E^c}(x) d\mu(x)\\
&= \int x1_{E}(x) d\mu(x)-  \int x1_{[\mu(E),1]\cap E}(x) d\mu(x) + \int x1_{[0,\mu(E)]\cap E^c}(x) d\mu(x)\\
&\leq \int x1_{E}(x) d\mu(x) - \mu(E) \int 1_{[\mu(E),1]\cap E}(x) d\mu(x) + \mu(E)\int 1_{[0,\mu(E)]\cap E^c}(x) d\mu(x)\\
&= \int x1_{E}(x) d\mu(x) - \mu(E) \mu([\mu(E),1]\cap E) + \mu(E)\mu([0,\mu(E)]\cap E^c)\\
&= \int x1_{E}(x) d\mu(x) +\mu(E)[\mu([0,\mu(E)])-\mu([0,\mu(E)]\cap E)-\mu([\mu(E),1]\cap E)]\\
&= \int x1_{E}(x) d\mu(x) +\mu(E)[\mu(E) - \mu(E)]\\
&= \int x1_{E}(x) d\mu(x)
\end{aligned}
$$
A: Here's an idea to prove the lemma: We can approximate $E$ by an open set of the form $O=\bigcup_{i=1}^n(a_i,b_i)$, with $a_1<b_1<a_2<\cdots<b_n$. Then on one hand, we have $\mu(E)\sim\sum_{i=1}^n(b_i-a_i)$, and then
$$\int_0^{\mu(E)}xd\mu(x)\sim\int_0^{\sum_{i=1}^n{b_i-a_i}}xd\mu(x)=\sum_{i=1}^n\int_{c_i}^{c_{i+1}} xd\mu(x)$$
where $c_1=0$, and $c_{i+1}=(b_1-a_1)+\cdots+(b_i-a_i)$. On the other hand, we have
$$\int_E xd\mu(x)\sim\sum_{i=1}^n\int_{a_i}^{b_i}xd\mu(x)$$
Now we can show, say by induction, that for each $i$, the interval $(c_i,c_{i+1})$ stands to the left of the interval $(a_i,b_i)$, and since the identity function is increasing, we have $\int_{c_i}^{c_{i+1}}xd\mu(x)\leq\int_{a_i}^{b_i}xd\mu(x)$. Summing this over all $i$, we obtain
$$\int_0^{\mu(E)}xd\mu(x)\leq\int_E xd\mu(x),$$
and the same argument works in the case of a non-decreasing function.
You can make these approximation arguments formal with an $\epsilon$-argument.
A: This isn't a complete answer, but it was pointed out to me that this is a special case of the Hardy-Littlewood inequality.
A: Write $G(x) = \mu(E\cap[0,x]) $ and let $f : [0, 1] \to \mathbb{R}$ be non-decreasing. By noting that $x \geq G(x)$, we get
$$
\int_{0}^{1} f(x) \mathbf{1}_{E}(x) \, \mathrm{d}x
= \int_{0}^{1} f(x) \, \mathrm{d}G(x)
\geq \int_{0}^{1} f(G(x)) \, \mathrm{d}G(x)
= \int_{0}^{G(1)} f(u) \, \mathrm{d}u.
$$

If OP is not familiar to the theory of Lebesgue-Stieltjes integral, we can adopt an approximation argument to circumvent this technicality in the following way.
Let $g : [0, 1] \to [0, 1]$ be continuous and define $G(x) = \int_{0}^{x} g(t) \, \mathrm{d}t$. Then for $f$ as before,
$$
\int_{0}^{1} f(x) g(x) \, \mathrm{d}x
= \int_{0}^{1} f(x) G'(x) \, \mathrm{d}x
\geq \int_{0}^{1} f(G(x))G'(x) \, \mathrm{d}x
= \int_{0}^{G(1)} f(u) \, \mathrm{d}u,
$$
Now, since we know that the space $C([0,1])$ of continuous functions is dense in $L^1([0,1])$, we can find a sequence $(g_n)_{n\geq 1}\subset C([0,1])$ such that $g_n \to \mathbf{1}_E$ in $L^1$. Since $f$ is bounded, this implies
\begin{align*}
\int_{0}^{1} f(x)\mathbf{1}_{E}(x) \, \mathrm{d}x
&= \lim_{n\to\infty} \int_{0}^{1} f(x)g_n(x) \, \mathrm{d}x \\
&\geq \lim_{n\to\infty} \int_{0}^{\|g\|_{L^1}} f(x) \, \mathrm{d}x
= \lim_{n\to\infty} \int_{0}^{\|\mathbf{1}_E\|_{L^1}} f(x) \, \mathrm{d}x.
\end{align*}
Since $\|\mathbf{1}_E\|_{L^1} = \mu(E)$, the desired conclusion follows.
