TITLE: An interesting real analysis problem involving integrals
QUESTION [7 upvotes]: If $f$ is continuos in $[0,1]$ and $\int_0^1 f(x)dx=0$, then $f(c)=\int_0^c f(x)dx$ for some $c\in (0,1)$.
My attempt:
I defined the fuction $g:[0,1]\to \mathbb{R}$ by $g(s)=f(s)-\int_0^{s}f(x)dx$, for all $s\in [0,1]$. Notice that $g(0)=f(0)$ and $g(1)=f(1)$. I considered cases for $f(0)$ and $f(1)$. For example, if $f(0)f(1)<0$, then using the Intermediate Value Theorem, we can find $c\in (0,1)$ such that $g(c)=0$, that is $f(c)=\int_0^c f(x)dx$. But, I don't know how to proceed in the other case: $f(0)f(1)\geq 0$.

REPLY [3 votes]: Lemma 1: Let $g$ be a differentiable function $[0,1]\rightarrow\mathbb{R}$ such that $g'-g>0$ (resp. $<0$) on $(0,1)$ and $g(0)=0$, then $g>0$ (resp. $<0$) on $(0,1]$. 
Proof: (Zarrax's trick) Let $h=\exp(-x)g$. Then $h'$ is strictly positive on $(0,1)$ and $h(0)=0$, whence $h>0$ on $(0,1]$ and therefore $g>0$ on $(0,1]$.

Now let $g(x)=\int_0^xf(t)dt$. Let $\lambda(x)=g'-g$. Either $\exists c:\lambda(c)=0$ (in which case we are done) or $\lambda$ doesn't change sign on $[0,1]$. By lemma 1, $g(1)\neq 0$, which is a contradiction.