We can use the following:
Lemma. If $f$ is continuous on $[a,b]$ then for any $\epsilon > 0$ there exists $\delta > 0$ such that for any partition $P$ of $[a,b]$ with $\|P\| < \delta$ and any refinement $R$ of $P$, we have $|S(f,P) - S(f,R)| < \epsilon$.
Applying the lemma, we can show that if $f$ is continuous, then the Cauchy criterion is satisfied. That is, for any $\epsilon >0$ there exists $\delta > 0$ such that if $P$ and $Q$ are any partitions satisfying $\|P\|, \|Q\| < \delta$, then $|S(f,P) - S(f,Q)| < \epsilon.$
To see this, let $R = P \cup Q$ be a common refinement and take $\delta$ as specified in the lemma such that if $\|P\|, \|Q\| < \delta$, we have $|S(f,P) - S(f,R)| < \epsilon/2$ and $|S(f,Q) - S(f,R)| < \epsilon/2$. Whence, it follows that
$$|S(f,P) - S(f,Q)| \leqslant |S(f,P) - S(f,R)| + |S(f,Q) - S(f,R)| < \epsilon/2 + \epsilon/2 = \epsilon.$$
It remains to prove the lemma.
Since $[a,b]$ is compact, $f$ is uniformly continuous and for any $\epsilon > 0$ there exists $\delta >0$ such that if $|x - y| < \delta$, then $|f(x) - f(y)| < \epsilon/(b-a)$. Suppose $\|P\| < \delta$ and $R$ is a refinement of $P$. Any subinterval $[x_{j-1}, x_{j}]$ of $P$ can be decomposed as the union of subintervals of $R$,
$$[x_{j-1},x_{j}] = \bigcup_{k=1}^{n_j}[y_{j,k-1}, y_{j,k}],$$
and
$$\begin{align}\left|S(f,P) - S(f,R)\right| &= \left|\sum_{j=1}^n f(\xi_j)(x_j - x_{j-1}) - \sum_{j=1}^n \sum_{k=1}^{n_j}f(\eta_{j,k})(y_{j,k} - y_{j,k-1})\right| \\ &\leqslant \sum_{j=1}^n \sum_{k=1}^{n_j}|f(\xi_j) - f(\eta_{j,k})|(y_{j,k} - y_{j,k-1}) \\ &\leqslant \sum_{j=1}^n \sum_{k=1}^{n_j}\frac{\epsilon}{b-a}(y_{j,k} - y_{j,k-1}) \\ &= \epsilon\end{align}$$
Fix $\epsilon > 0$.
Let $M=m^2$ where $m > 1$ is an integer such that ${\large{\frac{6}{m}}} < \epsilon$.
Let $\sigma$ be the partition of $[0,1]$ consisting of the $M+1$ intervals $I_1,...,I_{M+1}$ with $I_k=[x_{k-1},x_k]$ where
$$
0=x_0 < x_1 < \cdots < x_{M+1}=1
\;\;\;\;\;
$$
and $x_1,...,x_M$ are defined by
\begin{align*}
x_1&=\frac{1}{m}\\[4pt]
x_k&=x_1+(k-1)d,\;\,\text{for}\;2\le k\le M\\[4pt]
d&=\frac{1-x_1}{M}=\frac{m-1}{m^3}\\[4pt]
\end{align*}
If $A,B$ are given by
\begin{align*}
A&=\left\{{\small{\frac{1}{n}}}{\;{\Large{\mid}}\;}1\le n\le m\right\}
\qquad\qquad\;\;\;\,
\\[4pt]
B&=\left\{{\small{\frac{1}{n}}}{\;{\Large{\mid}}\;}n > m\right\}
\\[4pt]
\end{align*}
then the following claims are immediate:
- Each element of $B$ lies in the interior of $I_1$.$\\[4pt]$
- Each element of $A$ lies in at most two of $I_2,...,I_{M+1}$.$\\[4pt]$
Now let $S$ be the Riemann sum given by
$$
S=\sum_{k=1}^{M+1}f(x_k^*)\Delta x_k
$$
where $x_k^*\in I_k$ and $\Delta x_k=x_k-x_{k-1}$.
Then we get the lower bound
\begin{align*}
S
&=
\sum_{k=1}^{M+1}f(x_k^*)\Delta x_k
\\[4pt]
&\ge
\sum_{k=1}^{M+1}(-1)\Delta x_k
\\[4pt]
&=
(-1)\sum_{k=1}^{M+1}\Delta x_k
\\[4pt]
&=
(-1)(1)
\\[4pt]
&=
-1
\end{align*}
and since
- $f(x_k^*)\le 1$ for all $k$.$\\[4pt]$
- For $2\le k\le M+1$, we have $f(x_k^*)=-1$ with at most $2m$ exceptions.
we get the upper bound
\begin{align*}
S
&=
\sum_{k=1}^{M+1}f(x_k^*)\Delta x_k
\\[4pt]
&=
f(x_1^*)\Delta x_1+\sum_{k=2}^{M+1}f(x_k^*)\Delta x_k
\\[4pt]
&=
f(x_1^*)x_1+d\sum_{k=2}^{M+1}f(x_k^*)
\\[4pt]
&\le
(1)(x_1)+d\bigl((1)(2m)+(-1)(M-2m)\bigr)
\\[4pt]
&=
-1+\frac{2(3m-2)}{m^2}
\\[4pt]
&<
-1+\frac{6}{m}
\\[4pt]
&<
-1+\epsilon
\\[4pt]
\end{align*}
Thus $-1\le S < -1+\epsilon$.
It follows that $f$ is Riemann integrable on $[0,1]$ and ${\displaystyle{\int_0^1 f(x)\,dx = -1}}$.
Best Answer
There are a few problems with your approach: when you write that you have to show that$$\overline{S_\sigma}<\varepsilon\ \forall\varepsilon>0,\tag1$$you don't tell was which partition $\sigma$ is, but then you acto as if it was a concrete partition. For instance, how do you know that $\frac\varepsilon2$ belongs to the partition. Besides, what you need to prove is that, for each $\varepsilon>0$, there is some partition $\sigma$ such that $\overline{S_\sigma}<\varepsilon$, which is not the same thing as $(1)$. And it is easy to do: just take $\sigma=\left\{0,\frac\varepsilon2,1\right\}$, if $\frac\varepsilon2<1$; otherwise, $\sigma=\{0,1\}$ will do.