I'm trying to understand the result 2 on this page by way of example. It says for a discrete random variable $X$, with PMF $f(x)$, that the PMF of the transformed random variable $Y=r(X)$ we get a PMF
$$g(y)=\sum_{x\in r^{-1}\{y\}}f(x)$$
Here's the problem for which I'm trying to apply this result.
Suppose that $X$ is uniformly distributed on the integers $0$ to $9$. What is the mean of $Y=5X$?
For starters, I know that
$$f(x)=\begin{cases}\frac1{10}&\text{for }x\in\{0,\ldots,9\}\\0&\text{otherwise}\end{cases}$$
and since $Y=r(X)=5X$, we have $X=r^{-1}(Y)=\frac Y5$. But then the theorem suggests that the new variable's PMF would be
$$g(y)=\sum_{x\in r^{-1}\{y\}}f(x)=\sum_{x=0}^9f(x)$$
The sum evaluates to $1$, so I'm convinced I'm misunderstanding something important.
What does it mean to sum over all $x\in r^{-1}\{y\}$? Is it not true that $r^{-1}\{y\}=\{0,\ldots,9\}$?
I've thought about this in another way using the CDF for $X$. Letting $F(X)$ denote the CDF for $X$ and $G(Y)$ the CDF for $Y$,
$$G(y)=\mathbb P(Y\le y)=\mathbb P(5X\le y)=\mathbb P\left(X\le\dfrac y5\right)=F\left(\dfrac y5\right)$$
I know that
$$F(x)=\begin{cases}0&\text{for }x<0\\\frac n{10}&\text{for }n-1\le x<n,~n\in\{0,\ldots,9\}\\1&\text{for }9\le x\end{cases}$$
which would yield
$$F\left(\dfrac y5\right)=\begin{cases}0&\text{for }y<0\\\frac n{10}&\text{for }5n-5\le y<5n,~n\in\{0,\ldots,9\}\\1&\text{for }45\le y\end{cases}$$
and so, if I'm not mistaken, the PMF for $Y$ is
$$g(y)=\begin{cases}\frac1{10}&\text{for }y\in\{0,5,\ldots,45\}\\0&\text{otherwise}\end{cases}$$
If this is correct, then
how do I arrive at this result using the theorem from the provided link?