Let $f:[0,1]\rightarrow[0,\infty)$ be a continuous function such that $\int_0^1f(x)dx=1$, and let $M=\max f(x)$. Show that: $$\frac{1}{2M}\le\int_0^1xf(x)dx\le1-\frac{1}{2M}$$
We have $1=\int_0^1f(x)dx\le\int_0^1Mdx=M$, so $M\ge1$. I tried several inequalities, but none of them seem to be working in this case. I could use a hint. Thank you!
Let $F(x) := \int_0^x f(s)\, ds$, $x\in [0,1]$. Then $F$ is continuously differentiable, monotone non-decreasing function, satisfying $$ F(0) = 0, \quad F(1) = 1, \quad 0 \leq F'(x) \leq M, \ \forall x\in [0,1]. $$ As a consequence, $$ \max\{0, 1- M(1-x)\} \leq F(x) \leq \min\{1, Mx\}, \qquad \forall x\in [0,1], $$ so that $$ \frac{1}{2M} \leq \int_0^1 F(x)\, dx \leq 1 - \frac{1}{2M}\,. \tag{1} $$ On the other hand, integrating by parts $$ \int_0^1 x\,f(x)\, dx = F(1) - \int_0^1 F(x)\, dx = 1 - \int_0^1 F(x)\, dx, $$ so that the required inequality follows from (1).