Consider a discrete random variable defined as follows: When $X=0$, $P(X=x) = .25$.
When $X=1, P(X=x) =.4$.
When $X=2, P(X=x) = .35$.
The moment generating function for $X$ will be: $$Mx(t) = .25 + .4e^t + .35e^{2t}$$
But then the question asks, Create the moment generating function for $Y = X^2 - X - 1$.
I don't understand how to do this.
All you have to do is create a mapping of each of the possible outcomes of $X$ to the corresponding outcome of $Y$: for example, if $X = 0$, then $$Y = X^2 - X - 1 = 0^2 - 0 - 1 = -1.$$ Similarly, what are the other possible values of $Y$? Then you directly get the probability distribution of $Y$, and you get the MGF for $Y$ in the same way you did it for $X$: $$M_Y(t) = \operatorname{E}[e^{tY}].$$ But be careful: if $X = 1$, then $Y = 1^2 - 1 - 1 = -1$ also, so in particular, $$\Pr[Y = -1] = \Pr[X = 0] + \Pr[X = 1].$$ More generally, you have to make sure you calculate the distribution of $Y$ for all outcomes of $X$ that give you the same $Y$.