I want to show that if $C$ is a category and $A\in\operatorname{object} C$ is an initial object and $f \in \operatorname{Mor}(D,A)$ for $D \in \operatorname{object} C$, then $f$ is a retraction morphism in $C$.
By definition of initial objects $\lvert\operatorname{Mor} (A,C)\rvert=1 $ for all $A \in \operatorname{object} C$, then for $D\in \operatorname{object} C$ $\exists! g \in \operatorname{Mor}(A,D)$ s.t. $f\circ g\colon A\longrightarrow A $. How can i show that $f\circ g= I_{A}$?