$X$ is a discrete random variable with p.m.f $$p(x)=\frac{|x|}{20}$$ for $x = -4, -3, ..., 3, 4$ and $0$ otherwise. I was also given $Y=X^2-1$.
Now I need to find $E(X)$. So, is $Y=X^2-1$ not important in this case?
If so, I tried:
$$E(X)=\sum_{i=1}^{4} p(x_i)x_i=\sum_{i=1}^{4}\frac{|x_i|x_i}{20}$$
Or should $i$ start from $-4$?
EDIT: Final answer should be $0$ if starting from $-4$?
Here is a sketch of the PDF $p(x) = |x|/20,$ for $x = -4, -3, \dots, 4.$ (PDF is alternate terminology for PMF.)
You can see that the 'balance point' of the PDF is $0$ so you ought to get $$E(X) = \sum_{\text{all } x}xp(x) = \sum_{x=-4}^4 x\frac{|x|}{20} = 0.$$ The actual computation is $\mu_x=E(X) = (-0.80) + (-0.45) + (-0.20) + (-0.05) + 0 + 0.05 + 0.20 + 0.45 + 0.80 = 0.$
That finishes one part of the problem, but I think there are other parts worth exploring. If you have not yet seen the ideas involved, I predict you will see them in your course soon.
Variance of a discrete random variable. You can also find $$E(X^2) = \sum_{x= -4}^4 x^2\frac{|x|}{20} = 3.20 +1.35+ 0.40 +0.05+ 0+ 0.05+ 0.40 +1.35 +3.20 = 10.$$
Then you could find $$Var(X) = \sum_{x=-4}^4 (x-\mu_x)^2p(x) = E(X^2) - \mu_x^2 = 10,$$ where I will let you fill in the details.
Function of a discrete random variable. You also mention the random variable $Y.$ The values of $Y = X^2 - 1$ are shown in the table below:
Then the possible values of $Y$ are $0, 3, 8,$ and $15,$ where $-1$ is omitted because it has probability $0.$ The respective probabilities are
$P(Y = 0) = 2/20,\, P(Y=3) = 4/20,\, P(Y=8) = 6/20,$ and $P(Y = 15) = 8/20.$ Notice that $2/20 + 4/20 + 6/20 + 8/20 = 20/20 = 1$ which must be true for the probabilities in a distribution. So the PDF of $Y$ is given by the following table:
Now, there are two ways in which to find $E(Y):$ First, in terms of $X$ as $$E(Y) = E(X^2 - 1) = E(X^2) - 1 = 10 - 1 = 9.$$
Second, using the distribution of $Y$ just derived: $$E(Y) = 0(1/10) + 3(2/10) + 8(3/10) + 15(4/10) = 90/10 = 9.$$
Finally, here is a plot of the distribution of $Y.$