Show that $f$ is Riemann integrable and that $\int_a^b f (x)dx = 0$ Let $k \in \mathbb{R}$, $x_0 \in [a, b]$, and define $f:[a, b] \to \mathbb{R}$ via
$$
\begin{cases}
    0 & x \ne x_0\\
    k & x= x_0
\end{cases}
$$
Show that $f$ is  Riemann integrable and that $\int_a^b f (x)dx = 0$.
I know that I need to show that the lower and upper Riemann sums must be equal, but in my mind they are not equal, because at the point $x=x_0$, it will have an upper sum of $k$ but a lower sum of $0$. However, I understand and can visualize how the entire integral is equal to $0$.
Edit: I find the upper Riemann sum by
$$
U(f,P_n)=\sum_{i=1}^n M_i\Delta x_i.
$$
I know that $\Delta x_i =\frac{1}{n}$, but I don't know how to write $M_i$ because the function will suddenly jump up to $k$ at a certain point.
 A: I don't see what I consider the salient points in the other answers, so here we go.

*

*What I always called the convenient criterion for integrability in my teaching is this: $f$ is integrable on $[a,b]$ if and only if for every $\epsilon>0$, there is a partition $P$ with $U(f,P)-L(f,P)<\epsilon$.


*Create a partition as follows. I will suppose $a<x_0<b$. You can take care of the other cases. If $k=0$, the function is the zero function and there's nothing to do (I hope).
Given $\epsilon>0$, let $P$ be the partition $t_0=a$, $t_1=x_0-\delta$, $t_2=x_0+\delta$, $t_3=b$. We choose $\delta>0$ small enough so that $t_0<t_1<t_2<t_3$ and then small enough so that $2|k|\delta<\epsilon$. If $k>0$, we have $U(f,P) = 2k\delta$ and $L(f,P)=0$. If $k<0$, we have $U(f,P) = 0$ and $L(f,P) = 2k\delta$. In either event, we have $U(f,P)-L(f,P)<\epsilon$. [You should draw pictures to see what's going on here. I'm leaving it to you to write out explicitly the formulas for $U(f,P)$ and $L(f,P)$.]
Combining 1 and 2, we have shown $f$ is integrable on $[a,b]$. A very important point is that we do not always need to use a partition into subintervals of equal length.
A: You make upper and lower sums by partitioning the interval $[a,b]$ into subintervals. The final upper and lower sums are the limits you approach as these subintervals get narrower and narrower.
Assuming $k\geq0$, the upper sum is $k$ when the subintervals are $1$ wide (for $k\leq0$ it is the lower sum that equals $k$ while the upper sum is $0$). What happens to the upper sum when the subintervals are narrower than $1$?
A: The upper and lower sums will not be equal, but the upper and lower integrals will be. I'm not sure what notation you use, so I will use the one I am most familiar with. For a partition $P=\{x_0,x_1,\ldots,x_n\}$, the upper and lower sums are respectively \begin{align*}
U(f,P) &= \sum^n_{i=1} \left(\sup_{x\in[x_{i-1},x_i]} f(x)\right)(x_i-x_{i-1}), \\
L(f,P) &= \sum^n_{i=1} \left(\inf_{x\in[x_{i-1},x_i]} f(x)\right)(x_i-x_{i-1}).
\end{align*} Note that the width of the intervals come into play here. You are right that the supremum or infimum of $f$ will take the value $k$ for one (or maybe two) of those intervals, but the width of those intervals could be very small so that contribution can be made as small as you like.
