Show that the function is Riemann integrable on $[a,b]$ and find $\int_a^b f$ Show that the function is Riemann integrable on $[a,b]$ and find $\int_a^b f$
$$
f(x) = 
\left\{
\begin{array}{c}
0, &a \le x < c \\ 
\frac{1}{2}, &x = c \\
1, &c < x \le b
\end{array}
\right.
$$
I'm think I'm supposed to pick a partition of $[a,b]$ then get the $\inf(f)$ and $\sup(f)$, but I'm having trouble understanding how to do that.
 A: It is actually much simpler than that. Just remember that a function which is continuous except by a countable number of points is Riemman Integrable. And this function is continuous except by the point $x=c$. Also, changing the value of the function by one point does not change the value of the integral. So, you $\int_a^b f(x) dx  = \int_a^b g(x) dx  = $ where $g(x) = 0$ if $a \le x \le c $ and $g(x) = 1$ if $c < x \le b$.
Finally, 
$$
\int_a^b g(x) dx = \int_a^c g(x) dx + \int_c^b g(x) dx
$$
But $g|_{[a,c]}$ and $g|_{(c,d]}$ are constants, so 
$$
\int_a^b g(x) dx = 0 (c-a) + 1 (b-c) = b - c.
$$
A: If you are really required to use the definition of integral, you could do something like this: 
Let $P=\{a=x_0\leq x_1\leq\dots\leq x_n=b\}$ be a partition of $[a,b]$ and let $U(f,P)$ and $L(f,P)$ be the upper and lower Riemann sums, respectively. We can assume that $c=x_j$ for some $j=0,1,\dots n$, because if not, we can just add that point to our partition. Then we have $U(f,P)=(c-x_{j-1})\cdot\frac{1}{2}+(b-c)\cdot1$ and $L(f,P)=(x_{j+1}-c)\cdot\frac{1}{2}+(b-x_{j+1})\cdot1$. Then $inf\space U(f,P)=sup\space L(f,P)=b-c$
