The expected value or mean of a random variable $g(X)$, denoted by $Eg(X)$. If $E|g(X)|=\infty$, we say that $Eg(X)$ does not exist. (Casella, G., & Berger, R. L. Statistical inference. Definition 2.2.1)
I am curious why we need to discuss $E|g(X)|$, rather than $Eg(X)$ directly, if expectation does not exist.