A group $F$ is free over a set $X$ if there exists an injection $\sigma: X \to F$ such that for any function $\alpha: X \to G$ to any group $G$ there exists a unique homomorphism $\phi : F \to G$ such that $\phi \sigma = \alpha$.
There is an exercise in 'A Course in the Theory of Groups' that asks us to prove that $ \langle Im \ \ \sigma \rangle = F$ using only the categorical definition. I am very frustrated because the problem seems very easy but I have still not found the solution. I imagine that if we let $\alpha = \sigma$ there should be some problem with the uniqueness of $\phi$. Also if $\langle Im \ \ \sigma \rangle$ is a proper normal subgroup of $F$ then letting $\alpha: F \to F \langle Im \ \ \sigma \rangle$ be the zero map will allow for both the zero homomorphism on F and the standard epimorphism to a quotient to make the diagram commute.
To simplify the notation, let's identify $X$ with its image under $\sigma$ in $F$ so $X = \mathsf{Im}(\sigma) \subseteq F$. Then by the universal property we have a homomorphism $\phi : F \rightarrow \langle X \rangle $ that fixes $X$. If $\iota : \langle X \rangle \rightarrow F$ is the inclusion homomorphism, then $\iota \circ \phi$ is a homomorphism from $F$ to itself that fixes $X$. But the identity function on $F$ is also a homomorphism from $F$ to itself that fixes $X$, so by the uniqueness part of the universal property $\iota \circ \phi$ is equal to the identity on $F$, which implies that $\iota$ is a surjection, so that $\langle X \rangle = F$.