It is trivial that if $f=0$ then $\int_{a}^b f(x)dx=0$.
Now suppose that $\int_a^b f(x)dx=0$. We need to prove that $f=0$, that means $f(x)=0$ for all $x\in [a,b]$. We use the contradiction to solve. In fact, assume that $\exists x_0\in [a,b]$ such that $f(x_0)>0$. Since $f$ is continuous at $x_0$, there exist a $\delta>0$ small enough such that $f(x)>\frac{f(x_0)}{2}$ for all $x\in (x_0-\delta, x_0+\delta)$, (since
$$\varepsilon = \frac{{f\left( {{x_0}} \right)}}{2} > 0,\,\,\exists \delta > 0:\left| {x - {x_0}} \right| < \delta \Rightarrow \left| {f\left( x \right) - f\left( {{x_0}} \right)} \right| < \frac{{f\left( {{x_0}} \right)}}{2}.)$$
Hence
$$\int_a^b {f\left( x \right)dx} \geqslant \int_{{x_0} - \delta }^{{x_0} + \delta } {f\left( x \right)dx} \geqslant \int_{{x_0} - \delta }^{{x_0} + \delta } {\frac{{f\left( {{x_0}} \right)}}{2}dx} = \frac{{f\left( {{x_0}} \right)}}{2}\int_{{x_0} - \delta }^{{x_0} + \delta } {dx} = \delta f\left( {{x_0}} \right) > 0.$$
This is a contradiction. So $f(x)=0$ for all $x\in [a,b]$.