Define $(0,1)^{\infty}$ as the infinite Cartesian product $(0,1) \times (0,1) \times \cdots$. Find an injection $ f: (0,1)^{\infty} \to (0,1)$.
I know how to write an injection from $(0,1)^2 \to (0,1)$. Take two fractions, take their decimal expansions that don't contain an infinitely long string of nine's, and then alternate decimal places. I do not know how to extend this to the case of $(0,1)^{\infty}$. I can take a countable set of infinite decimals, disallow an infinitely long string of nine's, but I can't "alternate" in the same way because then I'll never finish the first digit after the decimal point. If I alternate, e.g., first take the first digit, then the second, then the third, I can't guarantee that the entirety of each decimal is equal.
Help would be appreciated.