Integrability of a monotonic function and Darboux sum. I have two questions on integrability.
(a) Prove that $f(x)$ is integrable on $[a,b]$ if $f(x)$ is monotonic on the interval. 
(b) Define $f(x) = 1$ if $x$ rational, $0$ otherwise. Prove $f(x)$ is not integrable on $[0,1].$
For (a), there is a proof on my text book but it uses something called mesh which I dont understand. Is there any other simple proof for this?
For (b), the function is clearly not continuous on the interval which implies that it is not integrable. But how should I start the proof??
tnaks!!
 A: The standard proof of (a) goes by noticing that since $f$ is monotone, given any partition $P$, if $[x_{i-1},x_i]$ is one of the intervals in the partition, the largest value of $f$ on the interval is one of $f(x_{i-1})$ and $f(x_i)$, and the least value is the other one: If $f$ is increasing, the largest value is $f(x_i)$. If $f$ is decreasing, it is the other one. This means that if we pick a partition where all the intervals have the same length $(b-a)/n$, $U(f,P)-L(f,P)$ forms a telescoping sum, and it is easy to see that it converges to $0$ as $n\to\infty$. In case there is confusion, $U(f,P)$ denotes here the upper Riemann sum, and $L(f,P)$ the lower Riemann sum, that is, if $P=\{x_0,\dots,x_n\}$, then $$L(f,P)=\sum_{i=1}^n\inf\{f(x)\mid x_{i-1}\le x\le x_i\}\cdot (x_i-x_{i-1}),$$ and $$U(f,P)=\sum_{i=1}^n\sup\{f(x)\mid x_{i-1}\le x\le x_i\}\cdot (x_i-x_{i-1}).$$
In detail, if $f$ is increasing and $P$ is the partition into $n$ pieces of the same size, $$ U(f,P)-L(f,P)=\frac{b-a}n\sum_{i=1}^n (f(x_i)-f(x_{i-1}))=\frac{b-a}n(f(b)-f(a))\to0$$ as $n\to\infty$. If $f$ is decreasing, the argument is the same, but the sum is now $(b-a)(f(a)-f(b))/n$.
The standard proof of (b) goes by noticing that $f$ is discontinuous everywhere. This is much stronger than just "not continuous", as you say. But this uses the Lebesgue criterion ($f$ is integrable iff it is continuous a.e., and bounded), which seems like an overkill. Easier to note that $L(f,P)=0$ and $U(f,P)=1$ for any partition $P$.
The point in both cases is that $f$ is integrable iff for any $\epsilon>0$ there is $P$ such that $U(f,P)-L(f,P)<\epsilon$.
By the way, (a) is fairly classical. Although it is not stated this way, the proof above is essentially the one given by Newton in Lemma II of Book I of his Philosophiæ Naturalis Principia Mathematica, see here. What we did algebraically above with a telescoping sum, Newton does geometrically: See the figure accompanying Lemma II, and note that the rectangles $aKbl,bLcm$, etc, correspond to the differences $(M_1-m_1)(b-a)/n$, $(M_2-m_2)(b-a)/2$, etc., in the argument above, where $M_i= \sup\{f(x)\mid x_{i-1}\le x\le x_i\}$ and $m_i=\inf\{f(x)\mid x_{i-1}\le x\le x_i\}$. Newton then notes than translating these rectangles so they all line up below $aKbl$ gives us the area of the rectangle $aABl$, that is, $(f(b)-f(a))(b-a)/n$. (David Bressoud also draws attention to this argument by Newton in the Introduction to his nice A radical approach to Lebesgue's theory of integration.) 
One could suspect that the (Riemann) integrability of continuous functions could be verified just building on this argument, as it appears reasonable that any continuous function is piecewise monotonic -- Dirichlet seems to have believed that, as it is part of his argument that the Fourier series of a continuous function converges pointwise to the function. Nowadays, however, we know that this is false (and Dirichlet's theorem is false as well in full generality). 
The first correct proof of integrability of continuous functions is due to Cauchy, in his 1823 book, where the definite integral is defined for the first time not in terms of antiderivatives, but rather in terms of a particular version of Riemann sum. His argument, naturally, proceeds along different lines than (a) above.
A: Assume that $f(x)$ is monotonic increasing on the interval. Choose, for each $n$, a uniform partition, $P_n$ on $[a,b]$ which is a finite sequence of real numbers such that 
$$a=x_0<x_<\cdots<x_n=b.$$ 
 Fix $j\in \{1,2,\cdots,n\}$  and $\,x\in I_j,$ then 
$$m_j\leq f(t_j)\leq M_j,\;\;\text{where}\;\;t_j\in I_j,$$ 
Since $f$ is increasing,
\begin{align}m_j=\inf\{f(x):\;x_{j-1}\leq x< x_{j}  \}=f(x_{j-1}) \;\;\text{and}\;\; M_j=\sup\{f(x):\;x_{j-1}\leq x< x_{j}  \}\leq f(x_{j}).\end{align}
This means that
\begin{align}  &L(f,P_n)= \sum^{n}_{j=1}m_j(x_{j}-x_{j-1}) = \sum^{n}_{j=1}f(x_{j-1})(x_{j}-x_{j-1}) ,\\&U(f,P_n)= \sum^{n}_{j=1}M_j(x_{j}-x_{j-1})\leq \sum^{n}_{j=1}f(x_{j})(x_{j}-x_{j-1}).\end{align}
Let $\epsilon>0$ be given. Choose a partition, $P_\epsilon$, such that $\max\limits_{1\leq j\leq n}(x_j-x_{j-1})<\dfrac{\epsilon}{(f(b)-f(a)+1)}$, then
 \begin{align}U(f,P_\epsilon)-L(f,P_\epsilon)&\leq \sum^{n}_{j=1}\left[f(x_{j}-f(x_{j-1}) \right](x_{j}-x_{j-1})\\&\leq \max\limits_{1\leq j\leq n}(x_j-x_{j-1})\sum^{n}_{j=1}\left[f(x_{j}-f(x_{j-1}) \right]\\&<\dfrac{\epsilon \left(f(b)-f(a) \right)}{(f(b)-f(a)+1)}\\&<\epsilon\end{align} 
Thus, $f$ is integrable on $[a,b]$. The same thing can be done for monotonically decreasing function on $[a,b]$.
