[proofplan]
The proof uses only the identity laws and associativity of composition in the category $\mathcal C$. Since $h$ is a right inverse of $f$, the identity morphism on $B$ can be replaced by $f \circ h$. Associativity then moves the parentheses so that the left inverse equation for $g$ can be applied, reducing $g$ to $h$.
[/proofplan]
[step:Insert the identity on $B$ after $g$ and replace it using $h$]
Since $g: B \to A$, the right identity law in $\mathcal C$ gives
\begin{align*}
g = g \circ \operatorname{id}_B.
\end{align*}
Because $h$ is an inverse of $f$, we have $f \circ h = \operatorname{id}_B$. Substituting this identity into the previous equality gives
\begin{align*}
g = g \circ (f \circ h).
\end{align*}
[/step]
[step:Reassociate the composition and use that $g$ is a left inverse of $f$]
The morphisms $g: B \to A$, $f: A \to B$, and $h: B \to A$ are composable in the displayed order, so associativity of composition in $\mathcal C$ gives
\begin{align*}
g \circ (f \circ h) = (g \circ f) \circ h.
\end{align*}
Because $g$ is an inverse of $f$, we have $g \circ f = \operatorname{id}_A$. Therefore
\begin{align*}
g = (g \circ f) \circ h = \operatorname{id}_A \circ h.
\end{align*}
[/step]
[step:Apply the left identity law to conclude equality of the inverses]
Since $h: B \to A$, the left identity law in $\mathcal C$ gives
\begin{align*}
\operatorname{id}_A \circ h = h.
\end{align*}
Combining the preceding equalities yields
\begin{align*}
g = h.
\end{align*}
Thus any two inverse morphisms of $f$ coincide.
[/step]