The setup of this problem is the following.
Tom is playing a game online. He keeps playing until he wins one game. Winning in the $n$th game will give a payout of $\frac{$100}{n}$. Each game is won independently with probability $p$.
I'm trying to find the expected winnings.
The number of games played before winning one follows a geometric distribution with parameter $p$. So Tom will play $\frac{1}{p}$ games, on average, before winning one. I intuitively imagine the winnings then to be $\$100 \times p$. Why exactly is this though?
If we let $X$ be the geometrically distributed random variable representing the number of games played when the first is won, then we can define the variable $Y = f \circ X$ where $f(n) = \frac{$100}{n}$ to represent the winnings. Directly trying to find the expectation of $Y$ gives $$ \operatorname{E}(Y) = \sum_{n=1}^\infty \frac{100}{n} (1-p)^{n-1} p $$ which I am not sure how to evaluate. How should I proceed to find the expectation, formally?
I noticed that the function $f$ is injective. Does this have a particular significance when trying to find expected values? Is there a more general theorem that relates the expectation of a function $f$ of a random variable $X$ to the expectation of $X$ itself?