Defined integral over a closed and bounded subset of $\mathbb{R}$ Let $[a,b]$ a closed and bounded subset of $\mathbb{R}$. Let $f: [a,b] \longmapsto \mathbb{R}$ be a continuous function. Is it true that if $$\int_{c}^{d}f(x)dx=0 $$ for every closed interval $[c,d]\subset(a,b)$, then it must be $f(x)=0$ for all $x \in [a,b]$?
Also, if $f:\mathbb{R}  \longmapsto \mathbb{R}$ is a continuous function such that $$\int_{c}^{d}f(x)dx=0 $$ for every closed and bounded set $[c,d]\subset\mathbb{R}$, then it must be $f=0$ on $\mathbb{R}$?
Hope someone can give me a hint.
 A: Start with "Assume, for contradiction, that $f(x)$ isn't $0$ everywhere. Let $x_0$ be such that $f(x_0)\neq0$." Then use continuity to find an interval over which the integral of $f$ is non-zero.
A: Let $F(x)=\displaystyle\int\limits_a^x f(t)\,\text{d}t.$ By the assumption we have that $F\equiv 0.$ But $F'(x)=f(x)$, so $f\equiv 0.$
A: For the first part, assume that there exists $x_0 \in (a,b)$ such that $f(x_0) \ne 0$.  WLOG, assume $f(x_0)>0$. (Replace $f$ by $-f$ if necessary.)   Due to the continuity of $f$, there exists $\delta>0$ such that for all $x \in (a,b)$,  $|f(x_0)-f(x)| > \dfrac{f(x_0)}{2} > 0$ whenever $|x_0-x| < \delta$.
Apply the First Mean Value Theorem for definite integrals, whose proof doesn't depend on differentiation, on $f$: there exists $\xi \in (x_0-\delta,x_0+\delta)$ such that
$$0 = \int_{x_0-\delta}^{x_0+\delta} f = f(\xi) \, ((x_0+\delta)-(x_0-\delta)) = 2\delta f(\xi) > 0$$
Contradiction.  Therefore, $f \equiv 0$ on $(a,b)$. (i.e. on $[a,b]$)
For the second part, note that closed and bounded interval is an instance of closed and bounded sets, so apply the previous part and we are done.
