Let $f:\mathbb{R}\to\mathbb{N}$ be onto. In ZF, no $g:\mathbb{N}\to\mathbb{R}$ s.t. $f(g(b))=b$ for all $b\in\mathbb{N}$ exists.
The above statement is from Goldrei, Classical Set Theory, p.104, exercise 5.2. The author states: "it can be shown that there is no way of constructing such a $g$ using the ZF axioms". More specifically, the author specifies that $f$ is an arbitrary function. Unfortunately, the author doesn't discuss this proof since it isn't exactly related to the material.
Would anyone have a reference on how one could do this proof, i.e., determine the difference of using choice and not using choice for this particular problem? Thank you very much!
EDIT: copy/paste of the statement following requests for clarification

What you are asking can be phrased as "Suppose that we are given a countable family of subsets of the real line, does it admit a choice function?"
To see that this is equivalent, note that if $\{A_i\mid i\in\Bbb N\}$ is a family of sets, we can define $B_i = A_i\setminus\bigcup_{j<i}A_j$, discard the empty sets and reenumerate (so just as well assume none is empty), and define $f(r)=n+1$ if $r\in B_n$, and $f(r)=0$ if $r\notin\bigcup B_n$. Now, if $g$ is an inverse function, then $g\restriction\Bbb N\setminus\{0\}$ is a choice function from the $B_n$s which let us choose from the $A_n$s.
The other direction is simpler, I leave it to you as an exercise.
Now, you can't blame Goldrei for omitting this proof. It is complicated and requires both forcing and basic understanding of inner models and relative constructibility, or alternatively a deep dive into the inner working of forcing in the form of symmetric extensions.
Nevertheless, the very first proof that $\sf AC$ is not a theorem of $\sf ZF$, given by Cohen, shows that it is consistent that there is a subset, $A$, of $\Bbb R$ which is infinite but Dedekind-finite, that is to say, it has no countable subset. It is not hard to show that such subset must be densely ordered, so by scaling we may assume that it is dense in $\Bbb R$. Now simply consider $A_n=A\cap(-\infty,n)$.
If you are looking for a good reference, this is known as Cohen's first model; the Halpern–Levy model; the Cohen–Halpern–Levy model; the Cohen model; and more. Introductions to it exist in Jech's "The Axiom of Choice" and "Set Theory" books, as are in virtually any other book which contains a proof that $\sf ZF$ does not prove $\sf AC$.