Let $X$ be the outcome of a fair die roll with probability mass function given by $$f_{X}(x)=\begin{cases}\frac{1}{6}&\text{ if }x\in\{1,2,3,4,5,6\}\\0&\text{ otherwise }\end{cases}$$ If $Y=(X−3)^2$, find the probability mass function of $Y$, $f_{Y}(y)$.
I already know the answer, but I don't understand how to solve the question at all. Here's the explanation in the answer sheet, below.
The probability mass function of $Y$ is expressed in terms of the known probabilities of $X$ as: $f_Y(y)=\mathbb{P}[Y=y]=\mathbb{P}[X\in\{x:(x-3)^2=y\}]$. We can calculate $f_Y(y)$ for each $y\in\{0,1,4,9\}$ as follows: (...the answer)
How did the domain of $X$ become $\{0,1,4,9\}$? What steps would be taken next?
Any help would be greatly appreciated, thank you.