Here's the problem statement, which is the context for my question,
Consider the measure space $(\mathbb{R}, B(\mathbb{R}), m)$ where $m$ is the Lebesgue measure, and let $u:\mathbb{R} \rightarrow \mathbb{R}$ be given by
$$ u=\sum_{k=1}^{\infty} \frac{(-1)^k}{k} 1_{[k, k+1)} $$
For which $p \geq 1$ does $\int |u|^p dm < \infty$?
The solution manual says that: Consider
$$ u_n=\sum_{k=1}^{n} \frac{(-1)^k}{k} 1_{[k, k+1)} $$
$u_n \rightarrow u$, (actually $u_n(x)=u(x)$ for all $n > x-1$) and since the sets $[k,k+1)$ are disjoint for all $k \geq 1$, we have that
$$ |u|^p=\sum_{k=1}^{\infty} \left| \frac{(-1)^k}{k} \right|^p 1_{[k, k+1)} $$ ...
so, I don't get the above equality. How do I get from
$$ |u|^p= \left| \sum_{k=1}^{\infty} \frac{(-1)^k}{k} 1_{[k, k+1)} \right|^p \quad \text{to} \quad \sum_{k=1}^{\infty} \left| \frac{(-1)^k}{k} \right|^p 1_{[k, k+1)} $$
It seems that I at least have to use the triangle inequality, but that would ruin the equality.
If you evaluate the sum that defines $u$ at a given point $x$, you'll see that at most one of the terms is non-zero. That's because $$u(x)=\sum_{k=1}^{\infty} \frac{(-1)^k}{k} 1_{[k, k+1)}(x) = \frac{(-1)^p}{p} $$ where $p=\lfloor x \rfloor$.