I want to find out for which $p\geq 1$ we have $u=\sum_{k=1}^\infty \frac{(-1)^k}{k}1_{[k,k+1)} \in \mathcal{L}^p$
I have tried the following: $$\int | \sum_{k=1}^\infty \frac{(-1)^k}{k}1_{[k,k+1)}|^p \, d\lambda$$ $$=\int \bigg( \sum_{k=1}^\infty \frac{(1)^k}{k}1_{[k,k+1)}\bigg) ^p \, d\lambda$$ $$=\int \sum_{k=1}^\infty \frac{1}{k^p}1_{[k,k+1)} \, d\lambda$$ and because $|u| \in \mathcal{M}^+$, switch integral and sum $$= \sum_{k=1}^\infty \int \frac{1}{k^p}1_{[k,k+1)} \, d\lambda$$ $$= \sum_{k=1}^\infty \frac{1}{k^p}\cdot 1$$ and so $u \in \mathcal{L}^p$ only for $p>1$ as it is a p-series
My doubt however, is that if it is allowed to switch the integral and sum because it is the absolute value. Also I don't know if the series converges because k changes all the time
Any hint would be appreciated
You are on the right track
Just for the justification of the switch of the summation to the $p-$power and the integral you can do this:
So the function is in $L^p$ if and only if $p>1$