Positive integral on interval implies subinterval such that function values are positive. How do I prove that if a real-valued function $f$ is integrable on $[a,b]$ and this integral is greater than $0$ then there exists an interval $[c,d]$ in $[a,b]$ such that $f(x)>0$ for all $x$ in $[c,d]$. I understand that the value of the integral can be no less than it's lower sums, however I am struggling with the partitions such that interval $[c,d]$ will yield $f(x)>0$. Thanks in advance!
 A: I will expand the hint given by Tom Apostol (see my comment to the question). Clearly the function $f$ must take positive values somewhere on interval $[a, b]$ (otherwise the integral will not be positive). Hence the upper bound $M$ of $f$ on interval $[a, b]$ is also positive. Let $I$ be the integral of $f$ over $[a, b]$ and we have $I > 0$. Let $$h = \frac{I}{2(M + b - a)} > 0\tag{1}$$ (the reason for this cryptic choice of a number $h$ dependent on $I$ and $M$ will be clear later) and let us define a set $T$ as $$T = \{x \mid x \in [a, b],\, f(x) \geq h\}\tag{2}$$ By the definition of Riemann integral it is possible to choose a partition $$P = \{x_{0}, x_{1}, x_{2}, \dots, x_{n}\}$$ of $[a, b]$ such that any Riemann sum $$S(P, f) = \sum_{k = 1}^{n}f(t_{k})(x_{k} - x_{k - 1})$$ for any choice of points $t_{k} \in [x_{k - 1}, x_{k}]$ satisfies the inequality $$|S(P, f) - I| < \frac{I}{2}\tag{3}$$ which gives us $$S(P, f) > \frac{I}{2}\tag{4}$$ Now the Riemann sum $S(P, f)$ can be broken into two parts with indices $k \in A$ if $[x_{k - 1}, x_{k}] \subseteq T$ and $k \in B$ otherwise. Then we have
\begin{align}
\frac{I}{2} &< S(P, f)\notag\\
&= \sum_{k = 1}^{n}f(t_{k})(x_{k} - x_{k - 1})\notag\\
&= \sum_{k \in A}f(t_{k})(x_{k} - x_{k - 1}) + \sum_{k \in B}f(t_{k})(x_{k} - x_{k - 1})\notag\\
&\leq \sum_{k \in A}M(x_{k} - x_{k - 1}) + \sum_{k \in B}h(x_{k} - x_{k - 1})\tag{5}\\
&\leq M\sum_{k \in A}(x_{k} - x_{k - 1}) + h(b - a)\tag{6}
\end{align}
In the equation $(5)$ above we have chosen points $t_{k} \in [x_{k - 1}, x_{k}]$ such that $f(t_{k}) < h$. From equations $(1)$ and $(6)$ we can now see that $$h(M + b - a) < M\sum_{k \in A}(x_{k} - x_{k - 1}) + h(b - a)$$ or $$\sum_{k \in A}(x_{k} - x_{k - 1}) > h$$ so that the intervals $[x_{k - 1}, x_{k}]$ corresponding to indices $k \in A$ have a non-zero length. And each of these intervals is a subset of $T$ where $f(x) \geq h$. It follows that $f$ is positive on these intervals $[x_{k - 1}, x_{k}]$.
