Every free module is a projective one I'm trying to understand this proof in Hungerford's book using the universal property of the free modules:

In the whole proof I didn't understand just this line, because we can use the uniqueness just in a function from $F$ to $A$ but $gh$ and $f$ are from $F$ to $B$, what am I missing?
Thanks

We can use uniqueness in any function from $F$ to any module.  Both $f$ and $gh$ are maps $F \to B$ and by design they agree on the basis of $F$.  Since any map out of $F$ is uniquely determined by where it sends the basis that means these two maps are the same, because they are both the unique map $F \to B$ determined by sending $x$ to $f(x) = gh(x)$.
So to be clear, the theorem about maps out of $F$ being uniquely defined by where they send $X$ is used twice in this proof.  First it's used to define a map $F \to A$ by saying what elements the $x \in X$ map too.  Second it's used to get that the maps $f$ and $gh$ are equal.  These are two different applications of the theorem so it's ok that one application concerns a map into $A$ and the other concerns maps into $B$.
