$$f(n) = \begin{cases} n & \text{if $n$ is irrational} \\ (n+1)/2, & \text{if $n$ is rational} \end{cases}$$
The way the function is constructed we can get to every rational in $(0,1)$ and every $f(n)$ is in $(0,1)$. Also $0$ maps to $1/2$ and $f(n)$ maps to $0$ if and only $f(n) = -1$, which we don't need to consider since $n$ must be in $(0,1)$. The function is clearly injective.