The easiest way to understand E[g(X)] is to think in terms of a random variable g(X) and then looking at it's mean.
So in the case of g(X) = X^2, we take our random variable and square it and this becomes a new random variable.
Then we look at the mean of this random variable and this is equivalent to E[g(X)] or E[Y] if Y = g(X) = X^2.
That's to give some intuition, but algebraically you can think of these as moments which actually have an interpretation in terms of the frequency spectrum of the random variable. I would use the explanation above for intuition and then just think about the complicated expressions in terms of algebra (try not to think too hard about things like say E[log(X)] or E[X^2 + X]).