Integrable function 2 We have the function
$$f(x) = \begin{cases}
1,\ \text{If $0\leq x<1$},\\
2,\ \text{If $1\leq x\leq 2$}.
\end{cases}$$
Is this function integrable in $[0,2]$.
My argument:

Since for all $x\in[0,2]$ is the case that $f(x)=1$ or $f(x)=2$, then $m_i^f<M_i^f$, and then for all $P\in\mathcal{P}([a,b])$ we have that $L(f,P)<U(f,P)$, and this implies that $\sup\{L(f,P) : P\in\mathcal{P}([a,b])\}< \inf\{U(f,P) : P\in\mathcal{P}([a,b])\}$. Therefore, $f$ is not integrable in $[0,2]$.

Here for $i=1,2,3,...$ we have that $m_i^f =\inf\{f(x) : x\in[p_{i-1},p_i]\}$, $M_i^f =\sup\{f(x) : x\in[p_{i-1},p_i]\}$  and $\mathcal{P}([a,b])$ denotes the set of all partions of $[a,b]$.
Am I right?

Choose partition $$P=(0=x_0<x_1<x_2<\dots x_k=1<x_{k+1}<\dots <x_n=2)$$
such that $$\max\left\{ (x_1-x_0), (x_2-x_1),.. (x_n-x_{n-1})\right\}\leq \delta<\frac{1}{10}$$
Define $$M_r=\sup_{x\in[x_{r-1},x_r]} f(x)$$ and  $$m_r=\inf_{x\in[x_{r-1},x_r]} f(x)$$
So $$U(P,f)-L(P,f)=\sum_{p=1}^{k-1}\left(M_p-m_p\right)(x_p-x_{p-1})+\sum_{p=k}^{n}\left(M_p-m_p\right)(x_p-x_{p-1})$$
$$=(M_k-m_k)(x_k-x_{k-1)}=(2-1)(x_k-x_{k-1})<\delta$$
Hence $$U(P,f)-L(P,f)<\delta $$
Since $$P\in\mathcal{P}[0,2]$$ is arbitary partition Hnece $f$ is Riemann integrable on $[0,2]$
