exlain how you know that, if f is continuous on [a,b], then there is a c in (a,b) such that f(c) = f avg, the average value of f on [a,b]

I have been able to show this by rearranging the mean value theorem for integrals

but the question also offers a hint:

Apply the mean-value theorem to g(x) = integral from a to x f(t) dt

can someone show me the solution using this hint explicitly