Since $\displaystyle f$ is continous it attains its maximum and minimum.
This means there are $\displaystyle k_1,k_2$ so that $\displaystyle f(k_1)\leq f(x)\leq f(k_2)$.
Since $\displaystyle g(x)\geq 0$ multiplication does not reverse inequality, $\displaystyle f(k_1)g(x)\leq f(x)g(x)\leq f(k_2)g(x)$.
Now integrate both sides, this is possible since $\displaystyle g$ is continous.
And finally the last statement follows by indetermediate value theorem for continous functions.