# Riemann-integrability of $\text{ sign}(\sin(\frac{\pi}{x}))$ on $[0,1]$

Let$$\begin{array}{rccc}f\colon&\mathbb [0,1]&\longrightarrow&\mathbb R\\&x&\mapsto&\begin{cases}sign(sin(\frac{\pi}{x}))&\text{ if }x\neq0\\0&\text{ if }{x=0}\end{cases}\end{array}$$ Prove that f is Riemann-integrable on $[0,1]$ and calculate $\int_{0}^{1}f(x)dx$.

What I have so far is:

Let $$\begin{array}\\&g(x)&=\begin{cases}1&\text{ if }x<\frac{\epsilon}{2}\\f(x)&\text{ otherwise }\end{cases}\end{array}$$

$$\begin{array}\\&h(x)&=\begin{cases}-1&\text{ if }x<\frac{\epsilon}{2}\\f(x)&\text{ otherwise }\end{cases}\end{array}$$ $$0\le\epsilon\lt2$$

Then $h(x)\le f(x)\le g(x)$ and $$\int_{0}^{1}g(x)dx-\int_{0}^{1}h(x)dx<(1-(-1))\frac{\epsilon}{2}=\epsilon$$ So f is R-integrable.

Is that correct so far? I am now stuck at computing $\int_{0}^{1}f(x)dx$. Can anyone help me with that?

• You need to prove that $g$ and $h$ are Riemann integrable, or quote a relevant theorem for that. To compute the integral, can you compute $$\int_{1/m}^1 f(x)\,dx\,?$$ Nov 23, 2017 at 16:13
• @newbie Is $f$ continuous almost everywhere? Nov 23, 2017 at 16:21

Note that since $f$ is continuous almost everywhere on $[0,1]$, it is Riemann integrable there. Moreover, we have
\begin{align} \int_0^1 \text{sgn}(\sin(\pi/x))\,dx&=\sum_{n=1}^\infty \int_{1/(n+1)}^{1/n} \text{sgn}(\sin(\pi/x))\,dx\\\\ &=\sum_{n=1}^\infty \int_{1/(n+1)}^{1/n} (-1)^n\,dx\\\\ &=\sum_{n=1}^\infty (-1)^n\left(\frac1n-\frac{1}{n+1}\right)\\\\ &=-\log(2)-(\log(2)-1)\\\\ &=1-2\log(2) \end{align}