Example of a function with only finitely many discontinuities which is not Riemann integrable? I know that bounded functions on compact intervals $[a,b]$ with only finitely (or countably) many discontinuities are Riemann integrable. What is an example of an unbounded function with only finitely many discontinuties defined on a compact interval $[a,b]$ which is not Riemann integrable? 
I assume there must be some for the bounded hypothesis to be needed.
 A: $$[a,b] = [-1,1], \quad f(x) = \begin{cases} 1/x, & x \ne 0 \\ 0, & x = 0 \end{cases}$$
This function  $f$ has exactly one discontinuity, at $x=0$.  Intuitively, $f$ should fail to be Riemann integrable because it has infinite area both above and below the $x$ axis.
To show this formally, suppose we are given a mesh size $\delta$; choose $n$ so large that $1/n < \delta$.  Since the harmonic series diverges, choose an $m > n$ so large that $\sum_{j=n+1}^m \frac{1}{j} \ge 1$.  Now consider the partition $\mathcal{P}$ of $[-1,1]$ consisting of $\{-\frac{i}{n}, 0, \frac{j}{m} : 1 \le i \le n, \, 1 \le j \le m\}$.  Note that the mesh of $\mathcal{P}$ is $1/n < \delta$.  Tag the partition $\mathcal{P}$ by choosing the points $-\frac{i}{n}$ and $\frac{j}{m}$, $1 \le i \le n$, $1 \le j \le m$ (you can check this indeed results in one point in each interval).  The Riemann sum of $f$ corresponding to this tagged partition is $$\sum_{i=1}^n \frac{1}{n} f(-\frac{i}{n}) + \sum_{j=1}^m \frac{1}{m} f(\frac{j}{m}) = \sum_{i=1}^n \frac{-1}{i} + \sum_{j=1}^m \frac{1}{j} = \sum_{j=n+1}^m \frac{1}{j} \ge 1.$$
On the other hand, if we choose the partition $\mathcal{P}' = \{ -\frac{j}{m}, 0, \frac{i}{n} : 1 \le i \le n, 1 \le j \le m\}$, then $\mathcal{P}'$ also has mesh $1/n < \delta$, and by a similar computation, the Riemann sum corresponding to $\mathcal{P}'$ is at most $-1$.
$\delta$ was arbitrary, so this shows that the Riemann sums do not converge as the mesh size tends to 0.  Thus $f$ is not Riemann integrable.
