Show that if a function is not negative and its integral is $0$ than the function is $0$

Since $f$ is continuous, let its anti derivative be $F$ such that $F'(x)=f(x)$. As $f(x)\ge0$ on $[a,b]$, $F(x)$ is increasing on $[a,b]$.

By the Fundamental Theorem of Calculus, $$\int_a^b f(x) dx= F(b)-F(a)$$ So, $$F(b)-F(a)=0$$ $$F(b)=F(a)$$ But $F$ is an increasing function on $[a,b]$. Thus, $F$ must be constant on $[a,b]$. Then, $$F'(x)=f(x)=0$$ on $[a,b]$.