Solution (source code)

= Solution

\b[True.] The <function composition> $j=g\circ f$ is an <injection>: $j(a)=j(a')$ first implies $f(a)=f(a')$ by the <injectivity> of $g$, then $a=a'$ by the <injectivity> of $f$. Fix one $a_0\in A$, using the given nonemptiness, and define
$$
h(c)=\begin{cases}a,&c=j(a)\text{ for some }a\in A,\\a_0,&c\notin j(A).\end{cases}
$$
The first case is well defined because $j$ is an <injection>. For every $a\in A$, $h(j(a))=a$. Thus this <left inverse> satisfies $\boxed{h\circ g\circ f=\operatorname{id}_A}$, the <identity function> on $A$.