If $ g\left(x\right)\geq f\left(x\right) $ and $ \intop_{a}^{b}g=\intop_{a}^{b}f $ then $ f=g $? Let $ g:[a,b]\to\mathbb{R} $ and $ f:[a,b]\to\mathbb{R} $ be continuous functions, such that $ f\left(x\right)\leq g\left(x\right) $ for any $ x\in[a,b] $.
Assume $ \intop_{a}^{\boldsymbol{b}}g\left(x\right)dx=\intop_{a}^{\boldsymbol{b}}f\left(x\right)dx $.
Is it true that $ f=g $?
I think that its true. I'll explain why:
we know that $ g\left(x\right)\geq f\left(x\right) $ and thus $ \intop_{a}^{\boldsymbol{b}}g\left(x\right)dx\geq\intop_{a}^{\boldsymbol{b}}f\left(x\right)dx $ so
$ \intop_{a}^{\boldsymbol{b}}(g\left(x\right)-f\left(x\right))dx\geq0 $
If we will assume by contradiction that $ g\neq f $ then we could find  $ x_{0}\in[a,b] $ such that $ g\left(x_{0}\right)-f\left(x_{0}\right)>0 $.
But $ f $ and $ g $ are continuous, and thus $ g-f $ is continuous, and we found $ x_0 $ such that $ (g-f)(x_0 $ is positive, thus the integral $ \intop_{a}^{b}\left(g-f\right) $ should also be positive.
So that's why it seems correct to me, but I wanted to make sure because that's a strong assumption to make.
Thanks in advance.
 A: You have the right idea, having $(g-f)(x_0)>0$ is not enough to conclude that the integral is positive. Instead of considering $h=g-f$, we can suppose $f=0$.
If $g\neq 0$, there is $x_0\in [a,b]$ s.t. $g(x_0)>0$. We can suppose WLOG that $x_0\in (a,b)$. Since $g$ is continuous, there is $\delta >0$ s.t. $$(x_0-\delta ,x_0+\delta )\subset (a,b)\quad \text{and}\quad g|_{(x_0-\delta ,x_0+\delta )}>0.$$ Let $M>0$ s.t. $g|_{(x_0-\delta ,x_0+\delta )}\geq M$ (such $M$ exist by continuity of $g$). In particular, $$\int_a^b g\geq \int_{x_0-\delta }^{x_0+\delta }g\geq 2M\delta >0,$$
which is a contradiction.
A: another method consider $$h(x)=\int_{a}^{x}(f(x)-g(x))dx$$
clearly $h'(x) \le0$ or it is non increasing   and $h(a)=0$ (given)  therefore $h(x)\le 0$ for all $x>a$.
given $h(b)=0$   and as $b>a$ it leaves us no choice but to accept $h(x)=0$
To explain the last point suppose there exists some $c$ in $(a,b)$ such that $h(c)$ is not zero. Then $ h(c)<0$ as mentioned above.(h(x) is decreasing.)Now as h(x) is decreasing we have $h(b)<h(c)<0$ thus a contradiction!
thus $h(x)=0$ for all x in $[a,b]$ or it is a constant function .
$h'(x)=0$ for all x in $[a,b]$. $f(x)=g(x)$
