# Riemann or Lebesgue integrable

Lets consider the following two functions:

$$f(x)=\begin{cases} x &,x\in[0,1]\setminus\Bbb Q \\ 0 &,x\in[0,1]\cap\Bbb Q\end{cases}$$ $$g(x)=\frac{(-1)^{[x]}}{[x]}$$

where $[x]$ is the integer part of $x$. I am trying to determine which of these integrals are Riemann or/and Lebesgue integrable; $f(x)$ over $[0,1]$ and $g(x)$ over $[1,\infty)$.

Lebesgue for $f(x)$: $\int_{[0,1]} f dx=\int_{[0,1]\setminus\Bbb Q}x\ dx + \underbrace{\int_{[0,1]\cap\Bbb Q}0\ dx}_{=0}=\int_{[0,1]\setminus\Bbb Q}x\ dx=\int_{[0,1]}x\ dx-\underbrace{\int_{\Bbb Q}x\ dx}_{=0}=\frac12$

Riemann for $f(x)$: I assume this function is not Riemann integrable, because every interval in a partition of $[0,1]$ will contain both rationals and irrationals, but I am not sure how to conclude.

Riemann for $g(x)$: The function takes the values $-1$ on $[1,2)$, $\frac12$ on $[2,3)$, $-\frac13$ on $[3,4)$, etc. So the integral is $-1+\frac12-\frac13+\frac14-\ldots=\sum_{k=1}^\infty(-1)^k\frac1k=-\log(2)$.

But I have no idea for the Lebesgue integral of $g(x)$.

$g$ is not lebesgue integrable, because the lebesgue integral of a function $g$ is defined as $$\int_\Omega g \,d\mu := \int_\Omega g_+ \,d\mu - \int_\Omega g_- \,d\mu$$ where $g^+$ is the positive part of $g$, i.e. $g_+(x) = |g(x)|$ if $g(x) \geq 0$ and $g_+(x)=0$ otherwise, and $g_-$ simiarly is the negative part of $g$. $g$ is only integrable if at most one of the integrals on the RHS diverge. In your case, I believe that both $g^+$ and $g^-$ are $+\infty$.
$f$ is not riemann integrable because it's discontinuous everywhere.
For $f$: show that for any partition there is a Riemann sum that is zero, and the one which is bigger than, say, $\frac14$. As a result, the Riemann sums do not converge to the same value. For the Lebesgue integrability of $g$ you have to check whether at least one of the integrals $\int g^+$ or $\int g^{-}$ is finite. Otherwise, Lebesgue integral is not defined. Here $g^+ = \max(g,0)$ and $g^{-} = \max(-g,0)$
• So $g$ is not Lebesgue integrable, because, e.g. $\int g^+$ is just the sum $\sum_{k=1}^\infty \frac{1}{2k+1}$, which diverges? – Phil-ZXX May 27 '13 at 10:56