I am interested in Lebesgue integral over $[0;1]$ of the function
$$f(x) = \sum_{n=1}^\infty n \cdot \chi_{[0;n^{-2}]}(x);$$
Here $\chi_{[0;n^{-2}]}(x)$ is $1$ if $x \in [0;n^{-2}]$ and $0$ otherwise.
So intuitively this should be $\zeta(1)$ (summand multiplied by the length of interval, all added together).
However once I wrote $$ A_i = \left[ \frac{1}{(i+1)^2} ; \frac{1}{i^2} \right ); $$
$$ \int_{[0;1]} f(x) d\mu = \sum_{i=1}^\infty \int_{A_i} f(x) d\mu = \sum_{i=1}^\infty \sum_{j=1}^i j \cdot \mu(A_i);$$
From here not everything goes as expected
$$ \int_{[0;1]} f(x) d\mu = \sum_{i=1}^\infty \frac{i(i+1)}{2} \cdot \left( \frac{1}{i^2} - \frac{1}{(i+1)^2} \right) = \frac{1}{2} \sum_{i=1}^\infty \left( \frac{i+1}{i} - \frac{i}{i+1} \right) = \frac{1}{2} \sum_{i=1}^\infty \left( \frac{1}{i} + \frac{1}{i+1} \right) = \zeta(1) - \frac{1}{2};$$
What is the problem?
The problem is that $\zeta(1) = \infty$. As far as I am able to check the computations, most of them are correct, except for the fact that some of the sums are in fact divergent. Also, just before the end, I think you mean something like: $$ \int f = \dots = \frac{1}{2} \sum_{i=1}^\infty (\frac{i+1}{i} - \frac{i}{i+1}) = \frac{1}{2} \sum_{i=1}^\infty (\frac{1}{i} + \frac{1}{i+1}) \\= \frac{1}{2} \sum_{i=1}^\infty + \frac{1}{2} \left( \sum_{i=1}^\infty \frac{1}{i} - 1\right) = \zeta(1) - \frac{1}{2} $$
The result is that $\zeta(1) - \frac{1}{2} = \zeta(1)$, which is true if you allow for infinities in your equations. It basically says that $\infty - \frac{1}{2} = \infty$. Note that we could legally sum some divergent sequences, because they converge to $+ \infty$. We definitely cannot subtract $\zeta(1)$ from both sides, to get $\frac{1}{2} = 1$.
Disclaimer: I am assuming $\zeta$ to be defined as $\zeta(t) = \sum_{n=1}^\infty \frac{1}{n^t}$. This is defined, and equal to $+\infty$ at $t= 1$. I know some complex-analysts would disagree.