Define $$f(x)=\begin{cases}x\qquad\text{if $2\leq x\leq 3$}\\ 2\qquad\text{if $3<x\leq4$}\end{cases}$$ Prove that the function $f:[2,4]\rightarrow\mathbb{R}$ is integrable.
Let $f=f_1+f_2$ where $f_1=x$ with $x\in[2,3]$ and $f_2=2$ with $x\in(3,4]$. To show $f$ is integrable, we will show $f_1,f_2$ both are integrable.
To show $f_1$ is integrable. Suppose that there is a partition sequence $P_n=\{i/n\}$ of $[2,3]$, where $i\geq 0,n\in\mathbb{N}$, then let $m_i=\inf f(x_i)=\frac{i-1}{n}$ and $M_i=\sup f(x_i)=\frac{i}{n}$ where $x_i\in[x_{i-1},x_i]$ and $[x_{i-1},x_i]$ is a sub-interval of $[2,3]$
Then $$L(f,P_n)=\sum_{i=1}^{n}m_i(x_i-x_{i-1})=\sum_{i=1}^{n}\frac{i-1}{n}(\frac{i}{n}-\frac{i-1}{n})=\frac{1}{n^2}\sum_{i=1}^{n}(i-1)=\frac{1}{n^2}\frac{(n-1)n}{2}$$ And $$U(f,P_n)=\sum_{i=1}^{n}M_i(x_i-x_{i-1})=\sum_{i=1}^{n}\frac{i}{n}(\frac{i}{n}-\frac{i-1}{n})=\frac{1}{n^2}\sum_{i=1}^{n}i=\frac{1}{n^2}\frac{n(n+1)}{2}$$
$$\lim\limits_{n\rightarrow\infty}[U(f,P_n)-L(f,P_n)]=\lim\limits_{n\rightarrow\infty}[\frac{1}{n^2}\frac{n(n+1)}{2}-\frac{1}{n^2}\frac{(n-1)n}{2}]=0$$ By the Archimedean-Riemann Theorem, $f_1$ is integrable on $[2,3]$
To show $f_2$ is integrable, we do the followings. Since $f(x)=2$ with $x\in(3,4]$, $f$ is bounded and its $U(f,P_n)=L(f,P_n)=2$ where $P_n$ is a partition sequence of $(3,4]$. $$\lim\limits_{n\rightarrow\infty}[U(f,P_n)-L(f,P_n)]=0$$ Hence, since $f_1,f_2$ both are integrable, $f$ is integrable on $[2,4]$
Can someone check this solution? I am not sure this is right or not. Thanks.