If $\int_a^b f(x) \ \mathrm{d}x = \int_a^b g(x) \ \mathrm{d}x$ then $\exists x \in [a,b]$ with $f(x) = g(x).$

Solution 1:

While your proof is correct, there are ways you could simplify it. For example, as noted in the comments, you could apply Rolle's theorem to $\int_a^x f(x') - g(x') dx'$ since you know it will be zero at the endpoints $a$ and $b$.