I would like to ask if the function $f(x)=\begin{cases}0\text{ if } x\in \mathbb{\mathbb{[0,1]}\cap Q}\\ x^2\text{ if } x\in \mathbb{[0,1]\setminus Q} \end{cases}$ is Riemann Integrable in $[0,1]$?
My thought:
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).
No, it is not Riemann-integrable, but your computations are not correct. You are right when you claim that $s(f,P)=0$, for each partition $P$ of $[0,1]$. However, it is not true that $S(f,P)=1$ for each partition $P$ of $[0,1]$. Actually, it is not true that “$M_i=1$ for all $i$, because every interval $I_i$ of the partition $P$ of $[0,1]$ contains rational numbers”. However, it is true that, for each partition $P$ of $[0,1]$, $S(f,P)\geqslant\frac13$, and this is enough to prove what you want.