# the definite Integral of $f \cdot g$ when $g$ is integrable and non negative and $f$ is continuous

if $f$ is a Continuous function on $[a,b]$ and $g$ is Riemann integrable and non negative on $[a,b]$ then there exists $\xi\in [a,b]$ and $$\int_{a}^{b}f(x)\cdot g\left(x\right)dx=f\left(\xi\right)\int_{a}^{b}g(x)$$

my attempt:

first if $f$ is continuous on a closed interval than its integrable, that means that $f \cdot g$ is integrable and thus $\int_{a}^{b}f(x)\cdot g\left(x\right)dx$ exists. now if $g$ is integrable than there exists a point $x_0 \in [a,b]$ and $\delta>0$ so that $g$ is continuous on the interval $(x_0 - \delta, x_0 +\delta)$. both $g$ and $f$ are continuous on this interval so there exists $F$ and $G$ anti-derivative functions of $f$ and $g$ that are derivative on $(x_0 - \delta, x_0 +\delta)$. now according to Cauchy's mean value theorem $$\frac{f\left(\xi\right)}{g\left(\xi\right)}=\frac{F\left(x_{0}+\delta\right)-F\left(x_{0}-\delta\right)}{G\left(x_{0}+\delta\right)-G\left(x_{0}-\delta\right)}=\frac{\int\limits _{x_{0}-\delta}^{x_{0}+\delta}f\left(x\right)dx}{\int\limits _{x_{0}-\delta}^{x_{0}+\delta}g\left(x\right)dx}$$

and here I sort of got stuck. Could be that this direction is not helpful at all, but i tried my best here. I'd take any suggestions now.

Since $f$ is continuous on the interval then there exist finite $m=\min\limits_{x\in[a,b]}f(x)$ and $M=\max\limits_{x\in[a,b]}f(x)$. You can easily check that in this case $$m\leq\frac{\int\limits_a^b f(x)\cdot g(x)dx}{\int\limits_a^b g(x)dx}\leq M$$ Now by mean value theorem there exist $\xi\in[a,b]$ such that $$f(\xi)=\frac{\int\limits_a^b f(x)\cdot g(x)dx}{\int\limits_a^b g(x)dx}$$