Let be f$:[a,b]\to \mathbb{R}$ a continuous function where $f(x)\geq 0$ for all $x\in[a,b]$.
Show that $\int_a^bf(x)dx=0 \implies f= \hat{0}_{|[a,b]}$.
My approach via contraposition:
Let be $c\in (a,b)$ with $f(c)>0$. Then we know that due to continuity there exists a neighbourhood $U_{\delta}(c):=\{x\in[a,b]\mid |x-c|<\delta\}$ such that for all $x\in U_{\delta}(c)$ it holds $f(x)>0$. We define a partition $P$ of $[a,b]$ as follows $P:=\{[a,c-\delta,c+\delta,b]\}$. If we now consider the lower Darboux sum we get: $$ L(f,P)=0(c-\delta-a)+m\delta+0(b-c+\delta)=m\delta>0,\\ \text{where } m:=\inf\{f(x)\mid x\in[c-\delta,c+\delta]\}. $$ We know that for every refinement of $P'$ of $P$ it holds: $L(f,P')\geq L(f,P)>0$ and hence $\sup\{L(f,P)\mid P \text{ is a partition of } [a,b]\}=\int_a^bf(x)dx>0$.
As $(A\implies B)\iff (\lnot B\implies \lnot A)$ the statement $\int_a^bf(x)dx=0 \implies f= \hat{0}_{|[a,b]}$ must be true. (Note if $c=a$ or $c=b$, then we can simply adjust the partition accordingly).
Why is this approach wrong? (my tutor said this)
The idea is sound. I think there's a small point to fix. The infimum that defines $m$ might yield $m=0$ even though the function is positive on the neighborhood $U$. You can just redefine $U$ so the function is at least $f(c)/2$ there, rather than just positive.