Given the function,
$h: [0, \infty) \rightarrow \Bbb R$,
$h(x)$ $:=$ $-1^{\lfloor x \rfloor} \over {\lfloor x+1 \rfloor}$,
I would like to check whether it is Riemann- or Lebesgue-integrable and calculate the value of the integral.
My approach looks like this:
$h(x)$ looks like a step function when we only take a look at it on intervals that possess a form like $(x_{k-1}, x_k)$ with $k \in \Bbb N$ and $k-1 < x_{k-1} < x_k < k$. In that case, we can write it as
$h(x)$ $=$ $-1^n \over n+1$ $\forall x \in (x_{k-1}, x_k)$, $\ k \in \Bbb N$.
Since every step function is Riemann-integrable by definition, $h(x)$ is Riemann-integrable too. But this means that it has to be Lebesgue-integrable too, meaning that
$\int_0^{\infty} |h(x)| < \infty$.
But this is not the case here since integrating the function gives us $\log$$($$1 \over n+1$$) $, and putting in the values gives us that $\int_0^{\infty} |h(x)| = \infty$, which is not the desired result.
Were am I mistaken?
$h$ is not Riemann integrable as Riemann integral exists only for functions defined on a closed bounded interval, which is not the case of $[0,\infty)$.
$h$ is not either Lebesgue integrable for the reason you noticed: $$\int_0^{\infty} |h(x)| \ dx = \infty.$$ However, $h$ is measurable as any step function.