Use the axiom of choice to prove that for any set $B$ there is a function $g:\mathcal{P}(B)-\{{\emptyset}\} \to B$ such that $g(A) \in A$ for every nonempty subset $A$ of $B$.
I see that the axiom of choice definition closely relates to the question at hand but I am not seeing how this can be used in the proof.
Note that $\emptyset \not \in \mathcal{P}(B) \setminus \{\emptyset\}$. Therefore there is a choice function $$f: \mathcal{P}(B) \setminus \{\emptyset\} \to \bigcup \left[\mathcal{P}(B) \setminus \{\emptyset\}\right]$$ such that for all $A \in \mathcal{P}(B) \setminus \{\emptyset\}$ we have $f(A) \in A$. (That's precisely the axiom of choice.)
But since $\bigcup \left[\mathcal{P}(B) \setminus \{\emptyset\}\right] = B$, that's equivalent to saying there is a function $f: \mathcal{P}(B) \setminus \{\emptyset\} \to B$ such that for all $A \subseteq B$ nonempty, we have $f(A) \in A$.