Solution (source code)

= Solution
{c}

Write $G=\int_a^bg(t)\,dt\geq0$ and $I=\int_a^bf(t)g(t)\,dt$. By the <extreme value theorem>, $f$ attains a <minimum> $m$ and a <maximum> $M$ on $[a,b]$. Because $g\geq0$, the <monotonicity of the Riemann integral> gives
$$
mG\leq I\leq MG.
$$
If $G=0$, this forces $I=0$, and every $c\in[a,b]$ satisfies the required identity. This includes $a=b$.

If $G>0$, divide to obtain $m\leq I/G\leq M$. The <intermediate value theorem>, applied between points where the <continuous function> $f$ attains $m$ and $M$, supplies $c\in[a,b]$ with $f(c)=I/G$. Hence the <weighted mean value theorem for integrals> gives
$$
\boxed{\int_a^bf(t)g(t)\,dt=f(c)\int_a^bg(t)\,dt.}
$$