# Show that if $\int_I f=0$ for all interval then $f=0$

Let $f$ integrable on $\mathbb R$ and continuous. I have to show that if for all interval $I\subset \mathbb R$, $$\int_If=0$$ then $f=0$.

My attempts

Suppose $f\neq 0$. Then, there is a $c\in\mathbb R$ s.t. $f(c)\neq 0$. Suppose WLOG that $f(c)>0$. By continuity, there is a $\delta>0$ s.t. $f|_{[c-\delta,c+\delta]}>0$ and thus $$\int_{c-\delta}^{c+\delta}f>0$$ which is a contradiction. Therefore $f=0$. (Notice that I can use the result $f>0\implies \int f>0$.)

Do you think it's correct ? It looks to easy, that's why I ask you.

• Yes, It is correct. – Erfan Khaniki Nov 26 '15 at 17:41
• yes that's right – user115608 Nov 26 '15 at 17:42
• Since there is consensus that your approach is correct, would you mind adding your attempt as an answer to the question? (This would be in order to get the question out of the unanswered questions list). – Peter Woolfitt Nov 26 '15 at 17:48
• Good solution, but I would bet that most people here would have suggested that you consider the function $$F(x) = \int_a^x f(t)\,dt$$ which apparently is everywhere zero (no matter what $a$ you happen to choose). – B. S. Thomson Nov 26 '15 at 17:59
• Yes its correct – Sarnavo Sarkar Nov 26 '15 at 18:06