# Riemann integrability of a piecewise function over $[1, 7]$

I have the following function

$$f(x) = \begin{cases} 2 & \text{if } 1 \leq x \leq 2, \\ 3 & \text{if } 2 < x \leq 4,\\ 1 & \text{if } 4 < x \leq 7. \end{cases}$$

How do I determine if the function is Riemann integrable within $$[1, 7]$$?

I think I have to check if the lower and upper integrals of $$f(x)$$ match but I’m unsure how to approach.

Any bounded function with countably many discontinuities is Riemann Integrable. Your function has only 3 discontinuity points and is thus Riemann integrable. In addition, this function is bounded. One them computes the Riemann integral in a piecewise fashion.

Since $$\int_a^b f(x) dx = \int_a^cf(x) dx + \int_c^b f(x)dx$$ you can split this integral into three parts, as $$\int_1^7 f(x) dx = \int_1^2 f(x) dx + \int_2^4 f(x)dx + \int_4^7 f(x) dx$$. Since $$f(x)$$ is constant on each of these intervals they are easily integrated.

hint

Let $$\epsilon>0$$ given and consider the partition $$\sigma$$ definef by $$\Bigl(1,2-\frac{\epsilon}{7},2+\frac{\epsilon}{7} ,4-\frac{\epsilon}{7}, 4+\frac{\epsilon}{7},7\Bigr)$$ then

$$U(f,\sigma)-L(\sigma,f)=$$ $$(3-2)\frac{2\epsilon}{7}+(3-1)\frac{2\epsilon}{7}=\frac{6\epsilon}{7}<\epsilon$$