Problem:
Let $f$ and $g$ be two continuous functions on $[ a,b ]$ and assume $g$ is positive. Prove that $\int_{a}^{b}f(x)g(x)dx=f(\xi )\int_{a}^{b}g(x)dx$ for some $\xi$ in $[ a,b ]$.
Here is my solution:
Since $f(x)$ and $g(x)$ are continuous, then $f(x) g(x)$ is continuous. Using the Mean value theorem, there exists a $\xi$ in $[ a,b ]$ such that $\int_{a}^{b}f(x)g(x)dx= f(\xi)g(\xi) (b-a) $ and using the Mean value theorem again, we can get $g(\xi) (b-a)=\int_{a}^{b}g(x)dx$ which yields the required equality.
Is my proof correct? If not, please let me know how to correct it.