Help with Proof intro topology

Don't really know how to prove this at all, I'm much appreciative of any help, i posted this once before, but really need more of an intro way to solve this proof.

Let f : [a,b] ⇒ ℝ be a continuous function. Show that there exists a w in [a,b] such that

a

∫ f(t)dt = f(w)(b-a)

b

Here is the hint that i __need__ to use to solve this problem:

f attains a smallest value A and a largest value B. Show that:

-----------a-----------------------------------------

A ≤ 1/(b-a)∫ f(t)dt ≤ B

-----------b-----------------------------------------

Thank you again for the help!