$f(x)=\begin{cases}x^3\text{ if } x\in \mathbb{\mathbb{R}\setminus Q}\\ \sin x\text{ if } x\in \mathbb{Q} \end{cases}$ is Riemann Integrable? I would like to ask if this piecewise function $f(x)=\begin{cases}x^3\text{ if } x\in \mathbb{\mathbb{R}\setminus Q}\\ \sin x\text{ if } x\in \mathbb{Q} \end{cases}$ is Riemann Integrable?
I thought it was at first since both $x^3$ and $\sin x$ are Riemann integrable, because it had similarities to the modified Dirichlet's function, which is Riemann Integrable. But curiously the (unmodified) Dirichlet function is not Riemann Integrable. I was wondering why one is integrable but one is not, and if this can help me see if my function is integrable or not. Thanks. 
 A: Since $\sin(x)$ is bounded by one, when x is greater than one, the upper sum will take values corresponding to $x^3$, but the lower sum will take values of $\sin(x)$. And because a function is Riemann integrable if and only if the lower sum ($s(f)$) and the upper sum  (S(f)) satisfy  $|S(f)-s(f)|<\varepsilon$. this function won't be Riemann integrable
A: Here is another explanation, that connects with some more sophisticated concepts.
A function is Riemann integrable iff it is continuous almost everywhere, with respect to the Lebesgue measure. Even if you haven't heard of Lebesgue measure, you can make sense of this statement!
Let's look at the points of continuity of $f(x)$. When $x^3\not=\sin x$, the function will have different limits as you approach $x$, depending on if you use rationals or irrationals. Thus the points of continuity of $f(x)$ are precisely the solutions of $x^3=\sin x$. There are only 3 solutions: $x\in \{0,\pm .929\}$. So for almost every value of $x$, the function is discontinuous at $x$.
Lebesgue measure makes the phrase "almost every" formal, because the measure of any finite set is 0. Thus the function is not Riemann integrable.
But as pointed out before, it is Lebesgue integrable, simply because it agrees almost everywhere with the nice function $x^3$.
