Set cardinality, function onto, open unit square maps into real number set I have a question in my homework that I have trouble solving it. I'm not sure if I understand the question actually. I'll attach the question below and hope someone could give me any hints.

Consider the open interval $(0,1)$, and let $S$ be the set of points in the open unit square; that is, $S = \{ (x,y): 0 &lt; x, y &lt; 1 \}$. Use the fact that every real number has a decimal expansion to produce a $1-1$ function that maps $S$ into $(0,1)$. Discuss whether the formulated function is onto.

edited: there's a hint in the question "keep in mind that any terminating decimal expansion such as .235 represents the same real number as .2349999... ."

I think the "formulated function" is the $f: S \to (0,1)$. I don't know how to use the decimal expansion concept.

Thanks
Do you know the extended problem of the Hilbert hotel? Suppose you have a hotel with infinitely many rooms numbered $R_1\cdots R_\omega$ which are all full. Suppose infinitely (but countably) many new guests arrive and you have to accommodate them all. The problem you have is very similar if you think of a point in $S=(a,b)$ as being the two sets of guests (the ones in the rooms already and the newly arrived ones) and the points in $(0,1)$ as each being a Hilbert hotel.You will ofcourse have to also deal with repeating decimals but you can manage that by just adding another set of guests to your hotel.
Consider the two sequences of decimal expansions of $x$ and $y$. How do you combine them into one sequence injectively?