Is the "first nonzero digit" function surjective? 
For sets $A= \{x \in \mathbb{R}: 0< x< 1 \}$ and $B=\mathbb{Z_+}$ let $f$ be a function $\space f:A \rightarrow B$ such that $f(x)$ is the position of the first nonzero digit of $x$, ex.g. $\space f(0.2)=1$, $\space f(0.02)=2$. Determine whether $f$ is injective and/or surjective.

Attempt: It is easy to see that $f$ is not injective since it produces same values for distinct x's.
I am having a difficulty with determining whether $f$ is surjective or not. To be surjective the cardinality of $B$ should be less or equal to the cardinality of $A$, $\left\vert{B}\right\vert \le \left\vert{A}\right\vert$. However, both sets have infinite number of elements. So, it might appear they are onto, but on second thought it looks like one set might be bigger than other, namely $\left\vert{B}\right\vert > \left\vert{A}\right\vert$ . I am a little confused here. Clarification would be very helpful. Thank you.
 A: You need to demonstrate with an example that there are distinct $x,y\in(0,1)$ such that $f(x)=f(y)$. Yes, it’s trivial to do, but the unsupported assertion that such values exist isn’t enough.
$B=\Bbb Z_+$ is countable, and $A=(0,1)$ is uncountable, so in fact $|A|>|B|$. However, you don’t need to worry about cardinality at all. Let $k$ be a positive integer; can you write down a specific number $x\in(0,1)$ such that $f(x)=k$? (HINT: You should even be able to specify one that has a terminating decimal expansion.)
A: Hint: A function $f:A \rightarrow B$ is surjective iff the following statement holds: $\forall b \in B, \exists a \in A$ s.t. $f(a) =b$.
You should now be able to prove (perhaps by induction?) that each $z \in \mathbb{Z}_+$ is mapped to by $f(x)$. (To use Michael Greinecker's comment:) you need to show that for each $z \in \mathbb{Z}_+$, there exists an $r \in \mathbb{R}, 0 < r < 1$ in which the first nonzero digit has position $z$.
A: Consider $n\in\mathbb{Z}_+$. Then there must exist $0<x<1$ such that for some $k\in\mathbb{N}$, $x=.000...k$, where the decimal has $n-1$ zeros followed by $k$. Hence $f(x)=n$ and $f$ is surjective.
A: The statement of the problem contains an answer: $f(0.2)=1; f(0.02)=2 ; f(0.002)=....$
