Let $X$ be a random variable whose distribution function is given by $$ \mathrm{F}\left(x\right) = \left\{\begin{array}{lcl} {\displaystyle 0} & \mbox{if} & {\displaystyle x < 2} \\[1mm] {\displaystyle{1 \over 3}\,x} & \mbox{if} & {\displaystyle 2 \leq x \leq 3} \\[1mm] {\displaystyle 1} & \mbox{if} & {\displaystyle x > 3} \end{array}\right. $$ Then find $E\left(X\right)$ and $E\left(X^{2}\right)$.
Given random variable is neither discrete nor continuous. Then by Jordan decomposition theorem first we have to write $X$ as a sum of a step function and a continuous function. But how should I do that ?.