How to prove that this function is integrable on $[0,1]$ Here I tried to find two step functions, one of them is less than $f$ on $[0,1]$ whereas one of them is greater than $f$ on the same closed interval, to prove this function is Riemann-integrable on this interval, however, I could not find such two step functions to help me show this function is integrable. May I get some hint about the solution to this problem?
Hint:

$$\int_0^1 (-1)^{[1/x]} \, dx = \lim_{n \to \infty}\sum_{k=1}^n\int_{1/(k+1)}^{1/k} (-1)^{[1/x]} dx = \lim_{n \to \infty}\sum_{k=1}^n\int_{1/(k+1)}^{1/k} (-1)^k dx \\ = \sum_{k=1}^{\infty} (-1)^k \left[\frac1{k}-\frac1{k+1} \right]=\sum_{k=1}^{\infty}  \frac{(-1)^k}{k(k+1)}$$

Alternatively consider a partition $P = (0, 1/n, \ldots, 1/2, 1)$.

The difference between upper and lower Riemann sums is $1/n$ since

$$\sup_{(1/(k+1),1/k]} f(x) - \inf_{(1/(k+1),1/k]} f(x) = (-1)^k - (-1)^k = 0,$$

and 

$$\sup_{[0,1/n]} f(x) - \inf_{[0,1/n]} f(x) = 1.$$

By choosing $n$ sufficiently large, this difference can be made smaller than any $\epsilon &gt; 0$ and $f$ is Riemann integrable.
First try to sketch the graph.

Denote the upper and the lower Riemann sums for a partition $P$ of a function $f$ by $U(P,f)$ and $L(P,f)$ respectively.

We say that $f$ is Riemann integrable if for any $\varepsilon &gt;0$ there is a partition $P$ such that $$\big| U(P,f)-L(P,f)\big|&lt; \varepsilon$$

Observe that the upper and the lower sums are always equal for a constant function.

Pick $\varepsilon &gt;0$. There is a natural number $N$ such that $\frac 2 {N} &lt; \varepsilon$

Consider the partition $0 &lt; \frac 1 N &lt; \frac 1 {N-1} &lt; \frac 1 {N -2} &lt; \cdots &lt; 1$

Now since $f$ is constant on $( \frac 1 2 , 1]$ and $( \frac 1 3, \frac 1 2 ]$ and $\dots$ and $( \frac 1 N,\frac 1 {N-1}]$, upper and lower sums will be equal in these intervals.

Also, $f$ is bounded above by $1$ and below by $-1$ gives that

$$\big| U(P,f) - L(P,f) \big| \leq \bigg| \big(1 \cdot \frac 1 N + \text{ some other terms} \big) - \big( -1 \cdot \frac 1 N + \text{ some other terms} \big) \bigg| = \frac 2 N &lt; \varepsilon$$

Many steps are missing in the proof above.