No. Not always. If you want to find expected value of Y(where Y is function of X), you can use LOTUS, which does not require you to know PMF of Y. You are still taking sum of elements from X and not Y.

Edit: In my comments I have said PMF. But it equally holds for PDF(i.e. when X is continuous random variable).

Now, consider $X^2=Y$, So, random variable $Y$ can take values $\{0,1\}$.

Now, according to you, $E[X^2] = E[Y] = 0*P(Y=0) + 1*P(Y=1)$

Here $P(Y=0) = P(X=0) = 0.5 $ and $P(Y=1) = P(X= -1) + P(X=1)= 0.5$

Now, put values, you will get the same answer. In 2nd case I have changed the function(Random Variable) but we have to consider probabilities according to our new random variable.

Please tell me if you are not getting it. I will explain through sample space and mapping, maybe from that you can visualize how things are happening here.