Integrability of the composition of a function with the integer part function I am wondering if the function
\begin{align*}
 f(x)= \left\{
 \begin{array}{lr}
 \lfloor\sin(\dfrac{1}{x})\rfloor &  x\neq 0 \\
 0\quad & x=0
 \end{array} \right.
 \end{align*}
is integrable on [0,1]?
I guess it is integrable by the countability of discontinuities. However, I can't prove or disprove.
 A: You are right. We can safely exclude the countably many singleton points, where $f(x)=1$. Then $f$ is constant $-1$ or $0$ on countably many intervals, so we can split the integral over those. Note that this is fine because $f$ is almost always negative, so we do not get $\infty-\infty$. 
According to wolframalpha, $\int_{-1}^0 f(x)dx=\frac{\log 2}{ \pi}-1$, for example. Interestingly, it seems that maple gives the value $\infty$ to the same integral, which is definitely wrong...
Another way to think about it, is that $f(x)$ is essentially $-\mathbb 1_{\{\sin\frac1x<0\}}$. $\sin$ and $\frac1x$ are measurable functions, so $\{\sin\frac1x<0\}$ is a measurable set, so the indicator function is integrable. 
EDIT:
I’ll work it out on $[0,1]$. For $x>0$, $\sin\frac1x<0$ if and only if $x\in(\frac{1}{(2k-1)\pi},\frac{1}{2k\pi})$ for some $k\ge 1$. Let $\tilde f(x):=\min(f(x),0)$; this only changes the value on countably many points. Then
$$
\int_0^1f(x)dx
= \int_0^1\tilde f(x)dx
= -\sum_{k=1}^\infty \frac1\pi\cdot \left(\frac{1}{2k-1}-\frac{1}{2k}\right)
= -\frac{1}{\pi}\sum_{i=1}^\infty \frac{(-1)^{i+1}}{i}
= -\frac{\log2}{\pi}
$$
where we used the sum of the alternating harmonic series. 
NOTE:
As mathcounterexamples.net has pointed out, integrable usually means that $\int |f(x)|dx<\infty$. Therefore, some of my above statements are wrong. Furthermore, I was thinking about the Lebesgue integral. What I should have said is that the function is Lebesgue integrable on any bounded interval, and that the Lebesgue integral is well-defined but $-\infty$ on $\mathbb R$. 
A: We can see that $f$ is bounded. After that, it would be interesting to precise which interval you consider for the integration. Let's consider two of those.
First consider the interval $ I=[0,1]$.
$f$ is a step function on each compact interval $[a,1] \subseteq [0,1]$ with $0<a<1$. Hence $f$ is Riemann-integrable. See here for a proof.
Second, $f$ is not Lebesgue integrable on $\mathbb R$
Clear considering $\inf(0,f)$ : $\int_{\mathbb R} \inf(0,f) = - \infty$.
