Proof. Suppose the statement does not hold, so \(f\) is not injective or \(g\) is not surjective. Let us consider both cases:

- \(\mathrm{f}\) is not injective, which means that \(\exists a, a^{\prime} \in A\) such that \(f(a)=f\left(a^{\prime}\right)\).

Now,

\[

(g \circ f)(a)=g(f(a))=g\left(f\left(a^{\prime}\right)\right)

\]

so we have \((g \circ f)(a)=(g \circ f)\left(a^{\prime}\right)\) but \(a \neq a^{\prime}\). So \(g \circ f\) is not injective, hence it is not bijective.

- g is not surjective, which means that \(\exists c \in C\) such that for all \(b \in B, g(b) \neq c .\) Moreover, \(g \circ f\) is surjective, so \(\exists a \in A\) such that \((g \circ f)(a)=c .\) Now, if \(b=f(a)\), then \(g(b)=c\), which is a contradiction!

Both cases lead us to the contradiction, hence we may conclude that if \(g \circ f\) is bijective, then \(f\) is injective and \(g\) is surjective.