Proof (Cauchy's mean value theorem)

Let $$ \phi(x) = \big(g(x)-g(a)\big)\big(f(b)-f(a)\big) - \big(g(b)-g(a)\big)\big(f(x)-f(a)\big).$$ $\phi$ is continuous $[a,b]$ and differentiable on $(a,b)$, and $\phi(a)=\phi(b)=0$.

By Rolle's theorem, there exists $c\in(a,b)$ such that $\phi'(c)=0$, which means $$ g'(c)\big(f(b)-f(a)\big) - f'(c)\big(g(b)-g(a)\big) = 0. $$