This can be shown using the concept of oscillation.
For a bounded $f$, the oscillation of $f$ over set $A$ (which is not a single point) is given by
$$w(A) = \sup_{A} f - \inf_{A} f$$
For a single point $x$, the oscillation is defined as
$$ w(x) = \inf_{J} w(J)$$
where $J$ ranges over bounded intervals containing $x$.
Note that if $x \in I$, then $w(x) \le w(I)$.
Now if $f$ is Riemann integrable over $[a,b]$, then we can show that given any $n \gt 0$, there is a sub-interval $I_{n}$ of $[a,b]$ such that $w(I_n) \le \frac{1}{n}$.
This is because, if every subinterval $I$ of $[a,b]$ had $w(I) \gt \frac{1}{n}$, then for every partition of $[a,b]$ the difference between the upper and lower sums would be at least $\frac{b-a}{n}$ and as a consequence, $f$ would not be integrable.
Now pick $I_{n+1} \subset I_{n}$ such that $w(I_{n+1}) \le \frac{1}{n+1}$.
By completeness there is a point $c$ such that $c \in I_n$.
Thus $w(c) \le w(I_n) \le \frac{1}{n}$ for all $n$. Hence $w(c) = 0$.
Now it can be show that $f$ is continuous at point $x$ if and only if $w(x) = 0$.
Note: This is basically a simplification of one proof of the Riemann Lebesgue theorem of continuity almost everywhere.
$\newcommand{\cl}{\operatorname{cl}}$Suppose first that $\langle S,d\rangle$ has the property that the intersection of countably many dense open sets is dense in $S$, and let $A$ be a first category set in $S$; we want to show that $S\setminus A$ is dense in $S$. Since $A$ is first category, there are nowhere dense sets $A_k$ for $k\in\Bbb N$ such that $A=\bigcup_{k\in\Bbb N}A_k$. For $k\in\Bbb N$ let $U_k=S\setminus\cl A_k$; each $U_k$ is a dense open subset of $S$, so $\bigcap_{k\in\Bbb N}U_k$ is dense in $S$. But
$$\bigcap_{k\in\Bbb N}U_k=\bigcap_{k\in\Bbb N}(S\setminus\cl A_k)=S\setminus\bigcup_{k\in\Bbb N}\cl A_k\subseteq S\setminus\bigcup_{k\in\Bbb N}A_k=S\setminus A\;,$$
so $S\setminus A$ is also dense in $S$.
Now suppose that the complement of every first category subset of $S$ is dense in $S$, and let $\{U_k:k\in\Bbb N\}$ be a family of dense open subsets of $S$. For each $k\in\Bbb N$ let $A_k=S\setminus U_k$; $A_k$ is closed and nowhere dense in $S$, so $A=\bigcup_{k\in\Bbb N}A_k$ is first category in $S$. Finally,
$$\bigcap_{k\in\Bbb N}U_k=\bigcap_{k\in\Bbb N}(S\setminus A_k)=S\setminus\bigcup_{k\in\Bbb N}A_k=S\setminus A\;,$$
which is dense in $S$, as desired.
A good book with much information on such topics is John C. Oxtoby, Measure and Category: A Survey of the Analogies between Topological and Measure Spaces, 2nd edition. (The first edition is also good.)
Best Answer
The statement is true because one can show there exists $\xi \in (a,b)$ such that $$\int_a^b f(x) \, dx \geq f(\xi) (b-a)$$
In fact assume that $$f(x) > \frac 1{b-a} \int_a^b f(y)\,dy$$ for all $x \in (a,b)$
Changing the values of $f$ at $a$ and $b$ if necessary (which doesn't alter the value of the integral), we have a new function $\hat{f}$ such that $$\hat{f}(x) > \frac 1{b-a} \int_a^b \hat{f}(y)\,dy$$ for all $x \in [a,b]$
Remember now the theorem discussed in this question.
Since $\hat{f}$ is continuous at some $c \in (a,b)$, we can find $\varepsilon > 0\,$ so that $$\hat{f}(x) > \frac 1{b-a} \int_a^b \hat{f}(y)\,dy + \varepsilon$$ for all $x \in (c-\varepsilon,c+ \varepsilon) \subset (a,b)$.
Then, if we consider the partition $P=\{a,c-\varepsilon,c+\varepsilon,b\}$, we obtain $$\int_a^b \hat{f}(x)\,dx \geq L(\hat{f},P) \geq \int_a^b \hat{f}(x)\,dx + 2\varepsilon^2 > \int_a^b \hat{f}(x)\,dx$$ which is absurd.
The paper Rodrigo Lopez Pouso, Mean Value Integral Inequalities , Real Anal. Exchange Volume 37, Number 2, (2011), 439-450 is worth reading not only as the source of this proof.