Prove that
$$f\left ( x \right )= \begin{cases} 1 & x \in \mathbb{Q}, \\ 0 & x\in \mathbb{R}\setminus \mathbb{Q}. \end{cases}$$
is not integrable.
I came across this. I think that the function itself is not continuous? But I do not think that is a legitimate answer to this question.
Let $S(f,P)$ and $s(f,P)$ be the upper and low sums of $f$ with respect to partition $P$ of interval $[0,1]$. Let $M_i=\sup\{f(x)| x \in I_i\}$ and $m_i=\inf\{f(x)| x \in I_i\}$, where $I_i$ is the $i$th interval of the partition $P$. Note that $M_i=1$ for all $i$, because every interval $I_i$ of the partition $P$ contains rational numbers. On the other hand, $m_i=0$ for all $i$ because every interval $I_i$ of the partition $P$ contains irrational numbers. By definition, $$S(f,P)=\sum_{i=1}^nM_i\mu(I_i)=\sum_{i=1}^n1\mu(I_i)=\sum_{i=1}^n\mu(I_i)=1-0=1$$ $$s(f,P)=\sum_{i=1}^nm_i\mu(I_i)=\sum_{i=1}^n0\mu(I_i)=0$$ Thus, $f$ is not Riemann integrable because the upper and lower integrals are not equal. (The upper integral is the limit of the upper sums and the lower integral is the limit of the lower sums).