The Mean Value Theorem for Integrals

Suppose that $f \in C[a,b]$. Prove that there exists points $p$ and $q$ in $[a,b]$ such that $$f(p)(b-a) \leq \int_{a}^{b}f \leq f(q)(b-a)$$

• Since $f \in C[a,b]$, this implies that $f$ must assume its max and min values by the extreme value theorem.
• Further, I can tell that $f(p)$ and $f(q)$ must be the max and min values on the interval, but I don't know how to express this and conclude that there must exist points $p$ and $q$ in the domain. Any help would be greatly appreciated.

Hint $f(p)=\text{min}_{x\in [a,b]} f(x)$, $f(q)=\text{max}_{x\in [a,b]} f(x)$, let $g(x)=f(p), h(x)=f(q)$, $\int_a^b g\leq\int_a^bf\leq\int_a^bh$. This implies the result.
In fact, the MVT says that we have equality for a $p$, which then proves the redundant inequalities.