How to show that $f(x) = 0$ if $\int_a^bf(x)\,\text{d}x=0$ for all $a,b\in\mathbb{R}$? I found this problem on the web:

Let $f(x)$ be a real-valued, continuous function with the property that $$\int_a^bf(x)\,\text{d}x=0$$for all real numbers $a,b$. Prove that $f$ is identically $0$.

So intuitively this seems very easy and obvious but getting a formal solution is hard. A formal proof would be nice. Thank you!
 A: Hint: Suppose by contradiction that $f(c) >0$, continuity provides you a $\delta >0$ such that $f(]c-\delta,c+\delta[)\subset \{t \in \Bbb R\mid t> \epsilon\}$ for some $\epsilon$ small enough. Then get a contradiction.
A: Let $a$ a fixed real and
$$F(b)=\int_a^bf(x)dx$$
then by the fundamental theorem of analysis we have 
$$0=F'(b)=f(b),\quad \forall b$$
A: Hint: for any fixed $x$, take $a=x$, $b=x+h$, and take the limit as $h\to 0$ (applying the fundamental theorem of calculus)..
A: Assume for a contradiciton that $f$ is not identically zero, so we have an $x$ such that $f(x)\neq 0$, without loss of generality say $f(x)>0$. Since $f$ is continuous you can take a small ball of radius $\epsilon$ around $x$ where $f$ takes strictly positive values. Integrate over $[x-\epsilon, x+\epsilon]$ and the integral must be strictly positive. This is our contradiction.
A: Let
$$
F(x) = \int_0^x f(t) \, dt.
$$
By assumption, $F \equiv 0$. By the fundamental theorem of calculus, $F$ is an antiderivative of $f$, i.e.
$$
f = F' \equiv 0.
$$
A: This was my submission. 
Say, for sake of contradiction, that $f(x)$ is non-zero for some real-valued $x=t$. That is, $ f(t) \ne 0 $. If $f(x)=c$ for all $x$, then $$ \displaystyle\int_{a}^{b} f(x) \, \mathrm{d}x = \displaystyle\int_{a}^{b} f(x) \, \mathrm{d}x = \displaystyle\int_{a}^{b} c \, \mathrm{d}x = c \cdot \left( b - a \right), $$which is non-zero for $ a \ne b $. Hence, $f(x)$ cannot be a non-zero constant for all $x$. 
If $f(t)=c$ and $f(u)=d$ for some $ t < u $ and $ c \ne d $ (that is, $f$ is not a constant function), then, since $f$ is continuous, the Intermediate Value Theorem states that there exists some $s,r\ne0$ such that $ t < r < u $, $ c < f(r) < d $ or $ d < f(r) < c $, depending on whether $ c < d $ or $ d < c $, and the same for $s$. That is, $(r,f(r))$ and $(s,f(s))$ are both between $(t,c)$ and $(u,d)$. Then, $$ \displaystyle\int_{c}^{r} f(x) \, \mathrm{d}x \ne \displaystyle\int_{c}^{s} f(x) \, \mathrm{d}x, $$so at least one of them is non-zero, so we have a contradiction. 

Another clever solution would be just to use the fundamental theorem of calculus. 
Let $F(x)=\displaystyle\int_a^xf(t)\text{ }dt$ where $a$ is a constant. Because of the given property, $F(x)=0$ for all $x.$
$F'(x)=f(x)=\dfrac{d}{dx}\text{ }0=0$, so we get the desired result.
A: If $f$ is not zero, there is an $x_0 \in \mathbf{R}$ ($f$ is necessarily defined on $\mathbf{R}$) such that $f(x_0) \not = 0$. Switching to $-f$ if needed we can assume that $f(x_0)>0$. As $f$ is continuous, with $\varepsilon = f(x_0) / 2$ we can find $\eta>0$ such that $|f(x) - f(x_0)| < \varepsilon$ whenever $|x-x0| \leq \eta$. Then for $x\in [x_0 - \eta, x_0 + \eta]$ we have $f(x) \geq f(x_0) - \varepsilon = f(x_0) - \frac{f(x_0)}{2} = \frac{f(x_0)}{2} ( > 0)$ which implies that $\int_{x_0 - \eta}^{x_0 + \eta} f(x)dx \geq \int_{x_0 - \eta}^{x_0 + \eta} \frac{f(x_0)}{2}dx = f(x_0) \eta >0 $, contradicting the hypothesis.
A: For $\forall x\in R, h>0$, by the Mean Value Theorem for integrals, there is $c\in(x-h,x+h)$ such that
$$ \int_{x-h}^{x+h}f(t)dt=f(c)\cdot2h $$
and hence $f(c)=0$. Letting $h\to0$ implies $c\to x$. by the continuity of $f$ at $x$, we have
$$ f(x)=\lim_{c\to x}f(c)=0. $$
Since $x$ is arbitrary, $f(x)\equiv0$ for all $x\in R$.
