Could anybody give an example of simple, nonnegative random variable, i.e. $$X = \sum_{i=1}^n a_i 1_{A_i}$$ where $a_i \ge 0, A_i \in \mathscr F, A_i \cap A_j = \emptyset$ on $\Omega = [0,1], \mathscr F = \mathscr B[0,1], \mathbb P = Leb$ such that $$E(X) < \infty, E(X^2) = +\infty$$
Here
All moments of bounded random variables are finite. If $|X| \leq M < \infty$ is finite, then $E[|X|^n] \leq M^n$ which is also finite.