show that $\int_{(0,1)} f dx = \infty$ Anyone knows how to show that $\int_{(0,1)} f dx = \infty$ 
where
$$
f(x)=
\begin{cases}
0 & \text{if $x \in \mathbb{Q}$}\\
[\frac{1}{x}]^{-1} & \text{if $x \notin \mathbb{Q}$}
\end{cases}
$$
 A: Edit: There were too many mistakes in the original answer. Thanks to Peter Melech for pointing them out.
The integral is actually $\frac{\pi^2}{6} - 1$, and not $+ \infty$.
Denote by $\mu$ the Lebesgue measure on $\mathbb{R}$.
Consider the simple functions
$$f_n = \sum\limits_{k = 1}^{n} \frac {1}{k} \cdot \chi_{\left(\frac{1}{k + 1}, \frac{1}{k}\right)\setminus \mathbb{Q}}$$
Note that if $x \in \left(\frac 1 {k + 1}, \frac 1 k\right)$, then $\left[\frac 1 x\right]^{-1} = \frac 1 k$ and therefore $f_n (x) = f (x)$ for every $n \ge \left[\frac 1 x\right] = k$.
It is easy to check that $f_n \le f$ for all $n$, and that $\lim\limits_{n \to \infty} f_n = f$ ae.
Further, 
$$\begin{align}
\int_{(0,1)} f_n \mathrm d \mu &= \sum\limits_{k = 1}^n \frac 1 k \cdot \mu \left(\left(\frac 1 {k + 1}, \frac 1 k\right)\setminus \mathbb{Q}\right) \\
&= \sum\limits_{k = 1}^n \frac 1 k \cdot \left(\frac 1 k - \frac 1 {k + 1}\right) \\
&= \sum\limits_{k = 1}^n \frac 1 {k^2} + \sum\limits_{k = 1}^n \frac{k - (k + 1)}{k (k + 1)}\\
&= \sum\limits_{k = 1}^n \frac 1 {k^2} + \sum\limits_{k = 1}^n \frac 1 {k + 1} -\frac 1 k\\
&= \sum\limits_{k = 1}^n \frac 1 {k^2} - 1 + \frac 1 {n + 1}
\end{align}$$
so we have $\int_{(0,1)} f \mathrm d \mu = \lim\limits_{n \to \infty} \left(\sum\limits_{k = 1}^n \frac 1 {k^2} - 1 + \frac 1 {n + 1}\right) = \frac{\pi^2}6 - 1 < + \infty$.
