I was reading the book of Real Analysis by H.L.Royden and they have given the definition of Riemann sums and Riemann integral as follows:
After this definition they have given the following footnote
Now I am not getting what the footnote 1 is saying. I think the statement of that note 1 is not always true. For example if we take the Dirichlet function (which is 0 on rationals and 1 on irrationals ) then the footnote 1 is not true. Am I correct or am I missing something?
(Edit:) My thoughts on why the foot note does not work for Dirichlet function:
We define $f:[0,1]\rightarrow \mathbb R$ by $f(x)=0$ if $x\in\mathbb Q$ and $f(x)=1$ otherwise. Now consider any partition $P$ of $[0,1]$. Then for any subinterval $[x_{i-1},x_i]$ we get $m_i=0$ because each subinterval will definitely have infinitely may rationals. Also $M_i=1$ because each subinterval will definitely have infinitely many irrationals. Then Lower sum will be 0 and upper sum will be 1.
Let's focus on upper Darboux sums and upper Darboux integral. The story for lower sums and integrals is similar.
Let us repeat the definitions for sake of clarity. Assume $f:[a, b] \to\mathbb {R} $ is bounded on $[a, b] $ with supremum $M$ and infimum $m$. Let $P=\{x_0,x_1,\dots,x_n\}$ be a partition of $[a, b] $ so that $$a=x_0<x_1<\dots<x_n=b$$ and define $$M_i=\sup\, \{f(x) \mid x\in(x_{i-1},x_i)\} ,M'_i=\sup\,\{f(x)\mid x\in[x_{i-1},x_i] \}$$ and $$U(f, P) =\sum_{i=1}^n M_i(x_i-x_{i-1}),U'(f,P)=\sum_{i=1}^n M'_i(x_i-x_{i-1})$$ and $$U(f) =\inf\, \{U(f, P) \mid P\in\mathcal{P} [a, b] \} =\inf \, A\, \text{ (say)} $$ and $$U'(f) =\inf\, \{U'(f, P) \mid P\in\mathcal{P} [a, b] \} =\inf\, A'\text{ (say)} $$ where $\mathcal{P} [a, b] $ is the set of all partitions of $[a, b] $.
Let's observe that we have $$M_i\leq M'_i, m\leq M_i, m\leq M'_i$$ and hence the upper sums $U(f, P) $ as well as $U'(f, P) $ are bounded below by $m(b-a) $ so that $U(f), U'(f) $ exist. Moreover for every element $a=U(f, P) \in A$ we have a corresponding element $a'\in U'(f, P) \in A'$ with $a\leq a'$. And vice versa for every element $a'\in A'$ there is a corresponding element $a\in A$ with $a\leq a'$.
Under these conditions we must have $\inf A\leq \inf A'$. To prove their equality we need to show that given any $\epsilon>0$ and given any member $a\in A$ we have a member $a'\in A'$ with $|a-a'|<\epsilon $.
Let us then start with partition $P$ of $[a, b] $ with upper sum $U(f, P) =\sum_{i=1}^{n}M_i(x_i-x_{i-1})$ and let $\delta =\min_{i=1}^{n}(x_i-x_{i-1})$. Let $k$ be a positive integer such that $1/k<\delta/2$.
We shall construct a sequence of partitions $P_k$ such that $$\lim_{k\to\infty} U'(f, P_k) = U(f, P) $$ The partition $P_k$ consists of all the points of $P$ as well as the points $$a+(1/k),b-(1/k),x_i\pm(1/k),i=1,2,\dots,n-1$$ so that there are a total of $(3n+1)$ points in $P_k$. And let us write $$M'_{ik} =\sup\, \{f(x) \mid x\in[x_{i-1}+(1/k),x_i-(1/k)]\} $$ and note that $$\lim_{k\to\infty} M'_{ik} =\sup\,\{f(x)\mid x\in(x_{i-1},x_i)\}=M_i$$ The sum $U'(f, P_k) $ contains terms corresponding to intervals $[x_{i-1}+(1/k),x_i-(1/k)]$ and these terms tend to $M_i(x_i-x_{i-1})$ and a finite number (exactly $2n$) of terms each of which is bounded in absolute value by $B/k$ where $B $ is a positive bound for $|f|$ on $[a, b] $ and these terms tend to $0$. It follows that $U'(f, P_k) \to U(f, P) $ as $k\to\infty $.
Therefore given any $\epsilon >0$ and an upper sum $U(f, P) $ we can find a partition $P'$ such that $|U'(f, P') - U(f, P) |<\epsilon $. We just have to choose $P'$ as one of the $P_k$ obtained by using $\epsilon $ in the limit definition. Thus our goal is achieved.