If there is such a function then there is an injection from $\omega_1$ to $2^{\omega}$.
(Set $\: X = \omega \:$, $\:$ send the finite ordinals to the corresponding singletons,
then extend to $\omega_1$ with transfinite recursiontransfinite recursion.)
If there is such a function and the continuum hypothesis holds then $\: 2^{\aleph_0} = \aleph_1 \:$.
It is consistent with ZF that the continuum hypothesis holds and $\: 2^{\aleph_0} \neq \aleph_1 \:$.
Therefore ZF does not prove the existence of such a function.