TITLE: Prove that $\exists a, b\in(0,1)$ such that $\int_0^{a} xf(x)dx=0\text{ and }\int_0^bxf(x)dx=\frac{b^2f(b)}{2}.$
QUESTION [7 upvotes]: Question: Let $f:[0,1]\to\mathbb{R}$ be a continuous function such that $f(0)=0$ and $$\int_0^1f(x)dx=0.$$ Prove that $\exists a, b\in(0,1)$ such that
$$\int_0^{a} xf(x)dx=0\text{ and }\int_0^bxf(x)dx=\frac{b^2f(b)}{2}.$$

My approach: Let $g:[0,1]\to\mathbb{R}$ be such that $$g(x)=x\int_0^xf(t)dt-\int_0^xtf(t)dt, \forall x\in[0,1].$$
By the first fundamental theorem of calculus we can conclude that $g$ is differentiable on $[0,1]$ and $$g'(x)=\int_0^xf(t)dt, \forall x\in[0,1].$$
Also, observe that $g(0)=0$ and $g(1)=-\int_0^1tf(t)dt$. Thus, by applying MVT to the function $g$ on the interval $[0,1]$, we can conclude that, $\exists c\in(0,1)$ such that $$g'(c)=\int_0^cf(t)dt=-\int_0^1tf(t)dt.$$
Observe that clearly three cases are possible, i.e, either$$\int_0^cf(t)dt<0\text{ or }\int_0^cf(t)dt=0\text{ or }\int_0^cf(t)dt>0.$$
Now let $h:[0,1]\to\mathbb{R}$ be such that $$h(x)=\int_0^xtf(t)dt, \forall x\in[0,1].$$
Please note that the part highlighted below is wrong, but still I have included it to just demonstrate my thinking process, as it might be of some help to others trying out this problem.

Observe that if $\int_0^cf(t)dt<0$, then, $h(1)>0$. This also implies that $\exists$ an open interval $(d,e)\in[0,c]$, such that $f(t)<0, \forall t\in(d,e)$. Now select any point $c_1\in(d,e)$. Applying MVT to the function $h$ on the interval $[0,c_1]$, we can conclude that $\exists c_2\in(0,c_1)$ such that $$h'(c_2).c_1=f(c_2).c_2.c_1=h(c_1)-h(0)=h(c_1)<0.$$
Now $h(c_1)<0$ and $h(1)>0$. Thus, by IVT we can conclude that $\exists a\in(c_1,1)\subseteq(0,1)$, such that $$h(a)=\int_0^af(t)dt=0.$$
A similar reasoning for the case when $\int_0^cf(t)dt>0,$ shows that $\exists a\in(0,1)$, such that $$h(a)=\int_0^af(t)dt=0.$$
Now finally if $\int_0^cf(t)dt=0$, then we will have $h(1)=0$. Now if $f$ is identically equal to $0$ on $[0,c]$, then clearly $tf(t)=0, \forall t\in[0,c]\implies h(x)=0, \forall x\in[0,c].$ Thus choosing any point $x\in(0,c]$ and setting it as $a$, we will have $h(a)=0$ and we will be done in that case.
Now if $f$ acquires both positive and negative values on $[0,c]$, then we can conclude that $\exists c_1,c_2\in(0,c)$, such that $f(c_1)>0$ and $f(c_2)<0$. Also, let us assume WLOG that $c_2>c_1$.

I have not been able to make any significant approach other than this. Can someone help me out with this problem? Please note that a solution using integration by parts might not be possible, since $f$ is not a differentiable function.

REPLY [9 votes]: The first part is answered in Olympiad calculus problem. We can build on Christian Blatter's answer to solve the second part.
Define $F(x) = \int_0^x f(t) \, dt$ and $\phi(x) = \frac 1x \int_0^x F(t)\, dt$, $\phi(0) = 0$. In Christian's answer it is demonstrated that
$$
 \phi'(x) = \frac{1}{x^2} \int_0^x tf(t) \, dt
$$
has a zero $a \in (0, 1)$, so that $\int_0^a tf(t) \, dt = 0$.
In our case we additionally have $f(0) = 0$, which implies that $\phi$ is differentiable at $x=0$ with $\phi'(0) = 0$. Applying the mean-value theorem to $\phi'$ gives that
$$
 \phi''(x) = -\frac{2}{x^3} \int_0^x tf(t) \, dt + \frac{f(x)}{x}
$$
has a zero $b \in (0, a)$, so that $\int_0^b tf(t) \, dt = \frac{b^2f(b)}{2}$.