Prove that a function is Riemann Integrable

Let $$f: [0,1] \rightarrow \Bbb R$$ defined by:

$$f(x)= \sin(\frac{1}{x})$$ if $$x \notin \Bbb Q$$ , $$0$$ if $$x \in \Bbb Q$$

I have to prove that this function is Riemann integrable in that interval.

It is bounded in $$[-1,1]$$ , and it's not continuous.

I have tried seeing if I could make $$U(f,P) - L(f,P) < \epsilon$$ for some partition $$P$$ , but I wasn't able to evaluate $$M_k$$ and $$m_k$$ , as for some intervals they could be $$0 , 1$$ or $$-1$$.

I also know that, if it was just $$\sin(\frac{1}{x})$$ , if would be integrable in that interval , as it would be continuous in $$(0,1]$$ , and we could ignore the discontinuity in $$\{0\}$$ as it is just a point.

Thank you in advance.

• Technically, it's not bounded in $[-1,1]$ because it's not defined in $[-1, 0)$. – enedil Mar 8 at 22:54
• Why is that so? – José Carlos Santos Mar 8 at 23:01
• i doubt if it is Riemann integrable. Using Darboux integral approach (equivalent to Riemann), the upper and lower sums could never converge to the same limit.. The function is Lebesgue integrable, but that is not the question. – herb steinberg Mar 8 at 23:03
• I think you can prove that it is not integrable by proving the Riemann integral does not exist on the interval $I= [2/\pi, 1]$. For any sub-interval of $I$, $(a,b)$, there exits values $x_1$ and $x_2$ in $(a,b)$ such that $f(x_1)=0$ and $f(x_2)\geq\sin(1)$. So no matter how small the minimum interval size, $\delta$, is there are two Riemann sums where one is 0 an the other is greater than $\sin(1)(1-2/\pi)$. – irchans Mar 9 at 1:20
• Like others have pointed out the function in question is not Riemann integrable because it is discontinuous at all points of $[0,1]$. A similar looking function $f(x) =\sin(1/q),x=p/q\in\mathbb {Q}$ and $f(x) =0,x\in\mathbb {R}\setminus \mathbb {Q}$ is however Riemann integrable. – Paramanand Singh Mar 9 at 8:41

You cannot prove it, since it is false. The set of points at which that function is discontinuous has Lebesgue measure greater than $$0$$.
Define $$g(x)=sin(\frac{1}{x})$$. Let $$f_+(x)=f(x)$$ for $$x\ge 0$$ and $$=0$$ for $$x\lt 0$$. Let $$f_-(x)=f(x)-f_+(x)$$. Similarly define $$g_+(x)$$ and $$g_-(x)$$. Then The upper Darboux sum of $$f_+(x)$$ will converge to the integral of $$g_+(x)$$, while the lower sum converges to $$0$$. Similarly the upper sum of $$f_-(x)$$ converges to $$0$$, while the lower sum converges to the integral of $$g_-(x)$$. Combing these results, the upper sum of $$f(x)$$ converges to the integral of $$g_+(x)$$, whille the lower sum converges to the integral of $$g_-(x)$$.
Therefore the upper and lower Darboux sums for $$f(x)$$ don't converge to the same value, thus not being Darboux integrable (or Riemann integrable).