Using a bit more machinery.
First note that
$$
X^2=\sum_{n=1}^\infty(2n-1)I(X\geq n)\tag{0}
$$
with probability one where $I$ is the indicator function. To see that this identity is true note that when $X^2=k^2$ (so $X=k$) for an integer $k\geq 1$ the RHS is
$$
\sum_{n=1}^k(2n-1)=\sum_{n=1}^k [n^2-(n-1)^2]=k^2
$$
as desired.
Take expectations of $(0)$ (use the Monotone Convergence Theorem to justify the interchanging of sums and expectations) to yield that
$$
EX^2=\sum_{n=1}^\infty(2n-1)EI(X\geq n)=\sum_{n=1}^\infty (2n-1)P(X\geq n)
$$
as desired.
A similar result can be realized from the identity
$$
X=\sum_{n=1}^\infty I(X\geq n)\tag{1}
$$
whence by the MCT
$$
EX=\sum_{n=1}^\infty P(X\geq n)
$$
In general for $m\geq 1$ an integer we have that
$$
X^m=\sum_{n=1}^\infty [n^m-(n-1)^m]I(X\geq n)\tag{2}
$$
whence
$$
EX^m=\sum_{n=1}^\infty [n^m-(n-1)^m]P(X\geq n).
$$
The identities (1) and (2) hold with probability one.