Let $f:\mathbb{N} \to \mathbb{Q}^+$ defined as follows : $$\begin{cases} f(0) = 0 \\ f(2n) = \dfrac{1}{f(n)+1} \\ f(2n+1) = f(n)+1 \end{cases}\,.$$ It is asked to prove the injectivity then the surjectivity of $f$.
After examining first values taken by $f$, I proved by induction that $f(2^k)=\dfrac{F_k}{F_{k+1}}$ where $(F_n)$ is the fibonacci sequence. Also one notes that if $m$ and $n$ have different parity then we can't have $f(m) = f(n)$ since $f(2\mathbb{N}) \subset (0,1)$ and $f(2\mathbb{N}+1) \subset [1,+\infty)$.
Any ideas on how to finish the proof of injectivity and any thoughts about surjectivity are welcome.
Thanks
Edit: I think I've managed to finish the proof of surjectivity, but a sanity check would be greatly appreciated.
Suppose $n,m > 1$. As you say, $f(n) = f(m)$ implies $m \equiv n \pmod{2}$. In particular, by the definition of $f$ we get either $f(n/2) + 1 = f(m/2)+1$ or $(f((n-1)/2) + 1)^{-1} = (f((m-1)/2)+1)^{-1}$ depending on the parity of $n$ and $m$.
Taking inverses at the second equality, one can realize that both conditions can be stated at once as
$$ f(n) = f(m) \Rightarrow f(\lfloor n/2 \rfloor) = f(\lfloor m/2 \rfloor). $$
Now, suppose that $f$ is injective in $\{0, \dots, n\}$. Then if $m \in \{0, \dots, n\}$ and $f(n+1) = f(m)$, it must be that $f(\lfloor n+1/2 \rfloor) = f(\lfloor m/2 \rfloor)$.
Since both $\lfloor n+1/2 \rfloor$ and $\lfloor m/2 \rfloor$ lie on $\{0, \dots,n\}$, by hypothesis we have that $\lfloor n+1/2 \rfloor = \lfloor m/2 \rfloor$. Hence
$$ 1 > \left|\frac{n+1}{2} - \frac{m}{2}\right| = \frac{1}{2}(n+1-m) $$
and so $n+1-m < 2$ which proves that $n -1 < m$. Since $m \leq n$, it should be $m = n$ but this would imply $n \equiv n+1 \pmod{2}$, a contradiction.
We therefore see that $f$ is injective in $\{0, \dots, n+1\}$, and inductively this proves that $f$ is injective in the whole domain.
As for surjectivity, consider
$$ a_0 \in \mathbb{N}_0, \quad a_{k+1} := 2a_{k}+1. $$
This sequence satisfies that
$$ f(a_{k+1}) = f(a_k) + 1 = \dots = f(a_0) +k, \tag{1} $$
and so taking $a_0 = 0$ we see that $f(\mathbb{N}) \supset \mathbb{N}$. Likewise we get
$$ f(2a_{k}) = \frac{1}{f(a_{k})+1} = \frac{1}{f(a_0) + k-1+1} = \frac{1}{f(a_0)+k}. \tag{2} $$
Once again, for $a_0 = 0$ this says that $\{\frac{1}{k}\}_{k \geq 1 } \subset f(\mathbb{N})$. Equation $(1)$ also tells us that if we solve the equation $f(j) = p/q$ for $p < q$ natural then $f$ is surjective, as every positive rational number is of the form $n + p/q$ with $n,p,q \in \mathbb{N}_0$ and $p < q$. As you have noted $j$ will have to be even.
In other words, we can reduce the problem to solving the equation
$$ f(2l) = \frac{p}{p+s} \tag{3} $$
for all $p,s \geq 1$ and we have already proven that this is solvable for $p = 1$.
Once again, we proceed by induction: suppose $(3)$ is solvable for all naturals lower than $p'$. Then,
$$ f(2l) = \frac{p'}{p'+s} \iff \frac{1}{f(l)+1} = \frac{p'}{p'+s} \iff f(l)+1 = \frac{p'+s}{p'} $$
and rewriting the latter, equivalently it is
$$ p'(f(l)+1) = p'+s \iff p'f(l) + p' = p' +s \iff p'f(l) = s $$
and so if $s = p'q + r$ with $r < p'$ we get
$$ f(l) = \frac{s}{p'} = q + \frac{r}{p'}. $$
Since by hypothesis $f(2l') = r/p'$ has a solution (because $r < p'$) we can set $a_0 = 2l'$ and then by $(1)$ it is
$$ f(a_{q+1}) = f(a_0) + q = q + f(2l') = q + \frac{r}{p'}. $$
Taking $l = a_{q+1}$, we conclude the inductive step, proving that $f$ is surjective.