PDF version
Extension material
Integration
\begin{Theorem 1}
If $f$ is integrable on $[a,b]$ and $g$ differs from $f$ on at most a finite number of points in $[a,b]$ then $g$ is integrable on $[a,b]$ and $\int_a^bg =\int_a^bf$
\end{Theorem}
\begin{proof}
Suppose first that $g_1$ differs from $f$ at one point $c\in[a,b]$.
Let $h=g_1-f$ on $[a,b]$. Then
\[
h(x)=\begin{cases}0&x\neq c,\\k&x=c.\end{cases}
\]
for some $k\in\mathbb{R}$.
Let $P$ be the standard partition of $[a,b]$ so $\delta x_i=(b-a)/n$ for $i=1,\cdots, n$. Suppose that c is in the subpartition $[x_{j-1},x_j]$. If $k>0$ then $m_j=0, M_j=k$ and if $k < 0$ then $m_j=k, M_j=0$.
We will assume $k>0$ as the $k<0$ is virtually identical. Since $m_i=M_i=0$ for $i\neq j$ we have:
\[
\begin{aligned}
L(h,P)&=\sum_{i=1}^nm_i\delta x_i = \sum_{i=1}^n0.\frac{b-a}{n}=0\to0\text{ as }n\to\infty\\
U(h,P)&=\sum_{i=1}^nM_i\delta x_i = \left(\sum_{i\neq j}0.\frac{b-a}{n}\right)+k.\frac{b-a}{n}=k.\frac{b-a}{n}\to0\text{ as }n\to\infty
\end{aligned}
\]
Hence $h$ is integrable and $\int_a^bh=0$ (Strategy 1.1 HB p89).
Then by the Combination Rules, $g_1=(g_1-f)+f=h+f$ is integrable on $[a,b]$ and $\int_a^b g_1 = \int_a^b h + \int_a^b f = 0 +\int_a^b f = \int_a^b f$.
Now let $g_2$ differ from $f$ at $c$ and one other point, so $g_2$ differs from $g_1$ at one point.
From the above result, $g_2$ is integrable on $[a,b]$ and $\int_a^b g_2 = \int_a^b g_1 = \int_a^b f$.
Continue in this way defining $g_1,g_2,\cdots ,g_m$ with $g_m=g$ then $g_1,g_2,\cdots ,g_m$ are (You can use induction)
integrable on $[a,b]$ and $\int_a^b g = \int_a^b g_m = \cdots = \int_a^b g_1= \int_a^b f$ proving the result.
\end{proof}
\textbf{Remark}
The Dirichlet function is not integrable on $[0,1]$ (AB3 Frame 13 p11) which shows that the result is not true if $g$ differs from an integrable (or even a continuous) function $f$ on a countable number of points but if we assume g itself is integrable on [a,b] then a countable number of discontinuities$^{[1]}$ doesn't affect the integral
[1] This means that the discontinuities can be put in a sequence.
\begin{Theorem 2}
If $f$ is integrable on $[a,b]$ and $g$ differs from $f$ on at most a countable number of points in $[a,b]$ and $g$ is integrable on $[a,b]$ then $\int_a^bg =\int_a^bf$.
\end{Theorem}
\begin{proof}
Again, let $h = g-f$ and let $C=\{c_1,c_2,\ldots,c_n\,\ldots\}$ be the countable set of points where $f$ and $g$ differ. Then $h(x)=0$ for $x\notin C$.
The function $|h|$ is also 0 for $x\notin C$ and $|h|(x)\geq0$ for all $x\in[a,b]$.
Let $P_n$ be the standard partition of $[a,b]$ with $\delta x_i=(b-a)/n,i=1,2,\ldots ,n$. Since each subinterval $[x_{i-1},x_i]$ is uncountable it contains points not in C where $|h|(x)=0$. Hence $m_i=0$ for $i=1,2,\ldots,n$ and thus
\[
L(|h|,P_n)=\sum_{1=1}^n m_i\delta x_i = \sum_{1=1}^n 0.(b-a)/n=0
\]
Since $f,g$ are integrable on $[a,b]$ so is $h$ by the Combination Rules and by the Modulus Rule $|h|$ is also integrable on $[a,b]$. Thus
\[
\int_a^b|h|=\lim_{n\to\infty} L(|h|,P_n) = \lim_{n\to\infty} 0 = 0.
\]
Finally, by the Triangle Inequality,
\[
\left|\int_a^bh\right|\leq\int_a^b|h|=0
\]
So, $\int_a^bh=0$ and, as before, $\int_a^b g=\int_a^b f$.
\end{proof}
\begin{Theorem 3}
There's no arbitrary constant for a primitive.
\end{Theorem}
\begin{proof}
In M208 a primitive is a function so it cannot be multi-valued and hence you cannot use a ‘constant’ that varies.
Also the constant depends on the interval so for example:
\[F(x)=\begin{cases}x^2 & x<0,\\x^2+1 & 0< x<1,\\x^2-2 & x>1.\end{cases}\]
is defined on $\mathbb{R} - \{0, 1\}$, and is differentiable at every point of its domain and $F\,'(x) = 2x$ for $x\in\mathbb{R} - \{0, 1\}$
$F$ is a primitive of $f(x) = 2x$ on $(0, 1)$ and similarly $F$ is a primitive of $f$ on $(-\infty, 0)$ and on $(1, \infty)$. But there's no $c$ for which $F(x) = x^2 + c$ for all $x\in\mathbb{R} - \{0, 1\}$.
\end{proof}
\begin{Theorem 4}
Let $f$ be the function with domain $\mathbb{R}$ and rule
\[f(x)=\begin{cases}0&x\neq0,\\1&x=0.\end{cases}\]
then $f$ is integrable on any interval that includes 0 but does not have a primitive on that interval.
Thus $f$ has a definite integral but no indefinite integral on an interval that includes 0.
\end{Theorem}
\begin{proof}
Since $f$ differs from the zero function at one point, Theorem 1 shows that $f$ is integrable on any interval $[a,b]$ and $\int_a^bf=0$.
Suppose, for a contradiction, that $F$ is a primitive of $f$ on $[a,b]$. Then by definition
$ F\,'(x)=f(x), \ x\in[a,b] $
(1)
and by the Fundamental Theorem of calculus
\[
\int_a^xf=F(x)-F(a)
\]
for any $x\in\mathbb{R}$ and hence any $x\in[a,b]$.
Since $\int_a^xf=0$ it follows that
\[
F(x) = F(a),\quad x\in[a,b]
\]
Hence $F$ is constant on $[a,b]$ so is differentiable on $[a,b]$ with $F\,'(x)=0,\ x\in[a,b]$ which contradicts (1) since $f(0)=1$ and $0\in[a,b]$.
Hence $F$ does not exist so $f$ does not have a primitive on $[a,b]$.
\end{proof}
\begin{Theorem 5}
Let $f$ be the Riemann function which has domain $\mathbb{R}$ and rule
\[
f(x)=\begin{cases}
1/q&\text{if }x=p/q,\, q>0\text{ with }p/q\text{ is expressed in lowest terms},\\
0&\text{if }x\text{ is irrational}.
\end{cases}
\]
then $f$ is integrable on any interval $I=[a,b]$, $\int_a^bf=0$ but does not have a primitive on $I$.
\end{Theorem}
\begin{proof}
We only need to show $f$ is integrable on $[a,b]$ and $\int_a^bf=0$. Then, as in proof of Theorem 3, a primitive $F$ would have to satisfy $F\,'(x)=0$ on $I$ so $F$ does not exist.
We use a similar method to showing $f$ is continuous on the rationals used in Theorem 3.3, AB1 to find the Riemann sums.
Let $P$ be a partition of $I$ then since $f(x)\geq0$ for all $x\in I$, $L(f,P)=0$ for any $P$.
Let $n$ be a positive integer. There are only a finite number of integers $q$ with $q < n$ and since $I$ is finite, only a finite number of points $p/q$ with $f(p/q)=1/q>1/n$. Suppose these points are $x_1,x_2,\cdots,x_k$.
Consider the subintervals $\left[x_i-1/2kN,x_i+1/2kN\right],i=1,\cdots,k$. Then the width of each subinterval $\delta x=1/kn$ and $M<1$ since $f(x)<1$ for all $x$. These intervals contribute an upper sum of $\sum_{i=1}^k 1/kn.1=1/n$
Divide the rest of the interval $I$ into subintervals of width $1/n$. These only include points $p/q$ with $q\leq 1/N$ so have upper sum of less than $\sum \delta x.1/n<(b-a)/n$.
$U(f,P)<1/n+(b-a)/n \to 0 $ as $n\to\infty$.
$\|P\|=\max\{1/kn,1/n\}=1/n \to 0 $ as $n\to\infty$.
$L(f,P)=0$
$f$ is bounded
By Theorem 1.3 HB p89, $f$ is integrable on $I=[a,b]$ and $\int_a^bf=0$
\end{proof}
\textbf{Remark}
The Riemann function $f$ in theorem 5 shows that differentiation is not always the inverse of integration. Define the function g with domain $\mathbb{R}$ and rule
\[
g(x)=\int_0^xf(t)\,dt
\]
Then by Theorem 5, $g(x)=0,x\in\mathbb{R}$ hence $g'(x)=0,x\in\mathbb{R}$. This means that $g'(x)=f(x)$ only when $x$ is irrational.
\begin{Theorem 6}
Let $F$ be the function with domain $\mathbb{R}$ and rule
\[F(x)=\begin{cases}x^2\sin(1/x^2)&x\neq0,\\0&x=0.\end{cases}\]
then $F$ is differentiable on any interval. Let $f=F\,'$ then $f$ has a primitive on any interval containing 0 but is not integrable on that interval.
Thus f has an indefinite integral but no definite integral on any interval containing 0.
\end{Theorem}
\begin{proof}
At 0 we have
\[
|Q(h)|=\left|\frac{F(0+h)-F(0)}{h}\right|=\left|\frac{h^2\sin(1/h^2)-0}{h}\right|=\left|h\sin(1/h^2)\right|\leq|h|
\]
hence
\[
-|h|\leq Q(h)\leq |h|
\]
By the Squeeze Rule for limits, $\displaystyle\lim_{h\to0}Q(h)=0$ so $F$ is differentiable at 0 with $F\,'(0)=0$.
With the Combination Rules for non-zero points we get
\[
f(x)=F\,'(x)=\begin{dcases}
2x\sin(1/x^2)-\frac{2\cos(1/x^2)}{x} & x\neq0,\\
0&x=0.
\end{dcases}
\]
By definition $F$ is a primitive of $f$ on any interval.
However, it is clear from the $\frac{2\cos(1/x^2)}{x}$ term, that $f$ is unbounded on any interval containing 0 (*) and this will mean it cannot be integrable on that interval since it will be unbounded on an at least one subinterval. Thus one or both of $\displaystyle\lim_{n\to\infty}L(f,P_n), \lim_{n\to\infty}U(f,P_n)$ don't exist so $f$ is not integrable by Theorem 1.2 HB p89.
\end{proof}
* To see this, any interval containing 0 will include $x=1/\sqrt{2n\pi}$ for sufficiently large $n$ and then $f(x)=-2\sqrt{2n\pi}$.
\begin{Theorem 7}
Let $f$ be the Dirichlet function which has domain $\mathbb{R}$ and rule
\[
f(x)=\begin{cases}
1&\text{if $x$ is irrational},\\
0&\text{if $x$ is rational}.
\end{cases}
\]
then $f$ is not integrable on any interval $I=[a,b]$ and does not have a primitive on $I$.
\end{Theorem}
\begin{proof}
If $P$ is any partition of $I=[a,b]$ then $L(f,P)=0$ and $U(f,P)=1$ and \[0=\upint_a^bf\neq\lowint_a^bf=1\] so $f$ is not integrable on $I$.
Suppose, for a contradiction, that $f$ has a primitive $F$ on $I$ so $F$ is differentiable on $[a,b]$ with $F'(x)=f(x),\ x\in [a,b]$.
[Note: As $F$ is differentiable at $a$ and $b$, $F$ is in fact defined on an open interval containing $I$].
If $I'=[a',b']$ is a subinterval of $I$ ie $a\leq a'\leq b'\leq b$, then $F$ is differentiable on $[a',b']$ with $F'(x)=f(x),\ x\in [a',b']$.
We can choose $a',b'$ with $a'$ irrational, $b'$ rational. Without loss of generality, we can drop the dashes and assume $a$ is irrational and $b$ is rational.
Define a function $g$ on $[a,b]$ by $g(x)=F(x)-\tfrac{1}{2}x,\ x\in[a,b]$. Then as $F$ is differentiable on $[a,b]$ so is $g$. Since $g$ is continuous on $[a,b]$, by the Extreme Value Theorem (HB p71) $g$ has a maximum value at some $c$ in $[a,b]$. If the maximum is also a local maximum then, as $g$ is differentiable at $c$, by the Local Extremum Theorem (HB p87), $g'(c)=0$.
But $g'(x) = F'(x)-\tfrac{1}{2}=f(x)-\tfrac{1}{2}=-\tfrac{1}{2}\text{ or }\tfrac{1}{2}$ for all $x\in I$, so the maximum is not local so must be at $a$ or $b$ (HB Corollary p87).
Thus we have, for all $x\in[a,b]$, either $g(x)\leq g(a)$ or $g(x)\leq g(b)$. This means that for all $x\in[a,b]$
\textit{either}
\begin{align*}
g(x)\leq g(a)\quad
&\Rightarrow\quad F(x)-\tfrac{1}{2}x\leq F(a)-\tfrac{1}{2}a\\[2ex]
&\Rightarrow\quad F(x)-F(a)\leq\tfrac{1}{2}(x-a)\\[2ex]
&\Rightarrow\quad \frac{F(x)-F(a)}{x-a}\leq\frac{1}{2}\quad \text{as }x\geq a\\[2ex]
&\Rightarrow\quad f(a)=F'(a)=\lim_{x\to a}\frac{F(x)-F(a)}{x-a}\leq\frac{1}{2}
\end{align*}
\textit{or}
\begin{align*}
g(x)\leq g(b)\quad
&\Rightarrow\quad F(x)-\tfrac{1}{2}x\leq F(b)-\tfrac{1}{2}b\\[2ex]
&\Rightarrow\quad F(x)-F(b)\leq\tfrac{1}{2}(x-b)\\[2ex]
&\Rightarrow\quad \frac{F(x)-F(b)}{x-b}\geq\frac{1}{2}\quad \text{as }x\leq b\\[2ex]
&\Rightarrow\quad f(b)=F'(b)=\lim_{x\to b}\frac{F(x)-F(b)}{x-a}\geq\frac{1}{2}
\end{align*}
Since $f(x)=0\text{ or }1$ we have that $f(a)=0$ or $f(b)= 1$ ie $a$ is rational or $b$ is irrational. This gives us our contradiction.
Hence a primitive on $I$ does not exist.
\end{proof}
The counter-examples above are not continuous as continuous functions are well behaved.
\begin{Theorem 8}
If $f$ is continuous on an interval $I=[a,b]$ then $f$ is integrable on $I$ and has a primitive on $I$.
\end{Theorem}
\begin{proof}
$f$ is integrable on $I$ by Theorem 1.5 HB p90.
Let $F(x)=\int_a^xf$. We show $F$ is a primitive of $f$ on $I$ by showing $F\,'(x)=f(x)$ for $x\in I$.
Let
\[
Q(h)=\frac{F(x+h)-F(x)}{h}=\frac{\int_a^{x+h}f-\int_a^x f}{h}=\frac{\int_x^{x+h}f}{h}
\]
using Additivity of Integrals HB p89
Since $f$ is continuous on $[a,b]$ it is continuous on the subinterval $[x,x+h]$ so by the Extreme Value Theorem HB p71, there exist $m_h,M_h\in[x,x+h]$ with $f(m_h)\leq f(y)\leq f(M_h)$ for all $y\in[x,x+h]$.
By the Inequality Rule (b) HB p91 we have $f(m_h)h\leq \int_x^{x+h}f\leq f(M_h)h$ so, dividing by $h$, $f(m_h)\leq Q(h) \leq f(M_h)$.
Let $h\to0$ and, since $f$ is continuous on $[x,x+h]$, $f(m_h), f(M_h)\to f(x)$ so by the Squeeze Rule for limits, HB p81, $\displaystyle \lim_{h\to0}Q(h)=f(x)$. Hence $F$ is differentiable on $I$ with $F\,'(x)=f(x)$ for $x\in[a,b]$, so $f$ is a primitive on $I$.
\end{proof}
\textbf{Remark}
A function $f$ on an interval $I$ can
- have a primitive and be integrable (continuous functions, Theorem 8)
- be integrable but not have a primitive (Theorems 4 & 5)
- have a primitive and not be integrable (Theorem 6)
- not have a primitive and not be integrable (Theorem 7).
Continuity of a function at all but a countable number of points means that the function is still integrable, though as Theorem 5 shows, it may not have a primitive.
\begin{theorem 9}
If $f$ is bounded and is continuous on $[a,b]$ except at a countable number of points then $f$ is integrable on $[a,b]$
\end{theorem}
\begin{proof}
Let $C=\{c_1,c_2,\dots,c_n\,\dots\}$ be the countable set of points where $f$ may not be continuous. $f$ is bounded (it has to be bounded to be integrable) so let $M=\max\limits_{x\in[a,b]} f(x)$ and $m=\min\limits_{x\in[a,b]} f(x)$.
Let $\varepsilon>0$ and let $\delta_n=\frac{\varepsilon}{3(M-m)2^{n-1}}$ and consider the intervals $I_n=(c_n-\delta_n,c_n+\delta_n)$ for $n=1,2,\dots$. Then $I_n$ is an interval centred on $c_n$ with length $l(I_n)=\frac{\varepsilon}{3(M-m)2^n}$.
Now remove all these intervals from $[a,b]$ and we are left with a countable number of disjoint intervals $J_1, J_2,\dots$ (each $I_n$ defines a $J_n$ to its left, plus there may be an extra $J$-interval on the right, so still a countable number of $J$-intervals.
Since the $J$-intervals are disjoint subsets of $[a,b]$ their total length must be less than $b-a$ ie
\begin{equation}
\kern{220mu}\sum_{i=1}^\infty l(J_i)\leq b-a\kern{220mu}(2)
\end{equation}
The lengths are all positive so the partial sums of this series form an increasing sequence bounded above, so by the Monotone Convergence Theorem the sequence, and hence the series, converge. This means that the tail of the series must get arbitrarily small, since if $s_n\to s$ then $s-s_n\to0$ where $s_n$ is the $n$-th partial sum.
Hence there is an integer N such that
\begin{equation}
\kern{200mu}\sum_{i=N+1}^\infty l(J_i)<\frac{\varepsilon}{3(M-m)}\kern{200mu}(3)
\end{equation}
By assumption $f$ is continuous on each $J$-interval so is integrable on these intervals. Hence by Riemann's Criterion, there exists a sequence of partitions $P_{i,n}$ of $J_i$ with $U(f,P_{i,n})-L(f,P_{i,n})\to0$. That means there is a partition $P_i$ of $J_i$ with
\begin{equation}
\kern{200mu}U(f,P_i)-L(f,P_i)<\frac{\varepsilon}{3N}\kern{200mu}(4)
\end{equation}
Let $P$ be the union of the partitions $P_i, i=1,\dots,N$ plus each of the $I$-intervals and remaining $J$-intervals $J_{N+1},J_{N+2},\dots$. We calculate $U(f,P)-L(f,P)$.
If Q is an interval then by definition $U(f,Q)=\sup_{x\in Q}f(x)) l(Q)< M.l(Q)$. Similarly $L(f,Q)>m.l(Q)$ so $U(f,Q)-l(f,Q)<(M-m)l(Q)$.
The partition $P$ consists of two types of intervals:
1. the partitions $P_1,\dots, P_N$ of $J_1,\dots,J_N$;
2. the single intervals $I_1,I_2,\dots$ and $J_{N+1},J_{N+2},\dots$
Hence
\begin{align*}
U(f,P)-L(f,P)&=\sum_{i=1}^N (U(f,P_i)-L(f,P_i))+\sum_{i=1}^\infty (U(f,I_i)-L(f,I_i))+\sum_{i=N+1}^\infty (U(f,J_i)-L(f,J_i))\\[3ex]
&<\sum_{i=1}^N \frac{\varepsilon}{3N}+\sum_{i=1}^\infty (M-m)l(I_i) + \sum_{i=N+1}^\infty (M-m)l(J_i)\qquad\text{by (2)}\\[3ex]
&<\frac{\varepsilon}{3}+\sum_{i=1}^\infty (M-m)\frac{\varepsilon}{3(M-m)2^n}+(M-m)\frac{\varepsilon}{3(M-m)}\qquad\text{by (3) and (4)}\\[3ex]
&=\frac{\varepsilon}{3}+\frac{\varepsilon}{3}\sum_{i=1}^\infty\frac{1}{2^n}+\frac{\varepsilon}{3}\\[4ex]
&=\frac{\varepsilon}{3}+\frac{\varepsilon}{3}+\frac{\varepsilon}{3}\\[2ex]
&=\varepsilon
\end{align*}
So we have proved that:
for each $\varepsilon>0$ there is a partition $P$ of $[a,b]$ with
$U(f,P)-L(f,P)<\varepsilon$.
Hence for each $\varepsilon>0$
\[
\upint_a^bf-\lowint_a^bf\leq U(f,P)-L(f,P)<\varepsilon
\]
which means that
\[
\upint_a^bf-\lowint_a^bf=0 \text{ and so }\upint_a^bf=\lowint_a^bf
\]
and thus $f$ is integrable.
\end{proof}
We can now prove an alternative to Theorem 2 using continuity of $g$ rather than integrability.
\begin{theorem 10}
If $f$ is integrable on $[a,b]$ and $g$ differs from $f$ on at most a countable number of points in $[a,b]$ and $g$ is continuous except at those points then $\int_a^bg =\int_a^bf$.
\end{theorem}
\begin{proof}
Theorem 8 shows that $g$ is integrable on $[a,b]$, so by Theorem 2 the result holds.
\end{proof}
\textbf{Example}
A simple example shows that we need to take great care when formulating results.
Consider the integer part function $F(x)=[x]$ with domain $\mathbb{R}$. Then $F$ is
differentiable on $\mathbb{R}-\mathbb{Z}$ with $F'(x)=0,\ x\in\mathbb{R}-\mathbb{Z}$. Clearly $F$ is not constant on $\mathbb{R}-\mathbb{Z}$ (see Theorem 3).
Since $F'$ is continuous at all but a countable number of points in $\mathbb{R}$, it follows from Theorem 9, that $F'$ is integrable on any interval $[a,b]$. Letting $g(x)=0,\ x\in\mathbb{R}$, Theorem 10 shows that $\int_a^bF' =\int_a^bg=0$.
However, if the interval $[a,b]$ includes an integer then $F(b)-F(a)\neq0$ so $\int_a^bF' \neq F(b)-F(a)$ and the Fundamental Theorem of Calculus doesn't apply, since $F$ is not a primitive of $F'$ on the whole of $[a,b]$. Indeed, the method in the proof of Theorem 4 shows that $F'$ doesn't have a primitive on $[a,b]$.
\textbf{Remark}
\textit{Counterexamples in Analysis by B.R. Gelbaum & J.M.H. Olmsted} is an excellent source for some of the examples used here.
\textbf{Advanced stuff}
We have concentrated so far on the slightly strange part of integration. But it is precisely the strange things that lead to advances in mathematics. So let's look at where it takes us, and, in particular, to find out exactly which functions are integrable.
However, we shall miss out proofs, some of which either use more advanced ideas$^{[2]}$ or are quite tedious or both!.
As Theorems 1 and 2 show, the values of the function at a finite or countable number of points don't affect the integral. These are examples of 'insignificant' sets and we now define what we mean by 'insignificant'.
[2] Such as compactness and the Heine-Borel Theorem
\begin{definition}
If $I=(a,b)$ is an open interval then the \emph{length} of $I$ is $b-a$ and we write $\ell(I)$. The length of the empty set is defined as 0.
\end{definition}
Definition
A set $S$ has \emph{measure zero} if for each $\varepsilon>0$ there is a sequence of open intervals $\{I_n\}$ covering $S$ (ie $S$ is a subset of the union of the intervals) such that $\sum\limits_{n=1}^\infty \ell(I_n)$ converges and $\sum\limits_{n=1}^\infty \ell(I_n)<\varepsilon$.
For example, let's suppose $S$ consists of just the two points 0 and 1. Then let $I_1=(-\frac{1}{8}\varepsilon,\frac{1}{8}\varepsilon)$, $I_2=(1-\frac{1}{8}\varepsilon,1+\frac{1}{8}\varepsilon)$ and $I_n=\varnothing$ for $n>2$. Then $S$ is a subset of $I_1\cup I_2$ and $\ell(I_1)=\ell(I_2)=\frac{1}{4}\varepsilon$ and $\sum\limits_{n=1}^\infty \ell(I_n)=\ell(I_1)+\ell(I_2)=\frac{1}{2}\varepsilon<\varepsilon$. Hence $S=\{0,1\}$ is a set of measure zero.
It's not difficult to show that a countable set $S=\{a_1,a_2,\dots,a_n,\dots\}$ has measure zero. Let $I_n=(a_n-2^{-(n+2)}\varepsilon,a_n+2^{-(n+2)}\varepsilon)$ then $a_n\in I_n$ for all n so $S\subseteq\bigcup\limits_{n=1}^\infty I_n$ and $\sum\limits_{n=1}^\infty \ell(I_n)=\sum\limits_{n=1}^\infty 2^{-(n+1)}\varepsilon=\frac{1}{2}\varepsilon<\varepsilon$ (using the sum of a geometric series).
However, there are uncountable sets (look up \emph{Cantor set}) that have measure zero.
Theorem 2 can be extended to apply to sets of measure zero.
\begin{definition}
If a function $f$ has a property P at all points of its domain except for a set of measure zero, then we say $f$ has property P \emph{almost everywhere} or \emph{a.e.}
\end{definition}
Now we can state exactly which functions are integrable.
\begin{theorem 11}
A bounded function is integrable on $[a,b]$ if and only if it is continuous almost everywhere on $[a,b]$.
\end{theorem}
In other words, we can integrate any function that is continuous except for a set of measure zero that we can ignore.
This is the beginnings of measure theory, which is a large and important, though difficult, part of pure mathematics.