Consider below two theorems about Injective and Surjective mappings
Theorem 1: If $f: A \rightarrow B$ and $g: B \rightarrow C$ be two mappings such that $g \,\circ\,f: A \rightarrow C$ is injective then $f$ is injective.
Theorem 2: If $f: A \rightarrow B$ and $g: B \rightarrow C$ be two mappings such that $g \,\circ\,f: A \rightarrow C$ is surjective then $g$ is surjective.
Theorem 1signifies that in order to $g \,\circ\,f$ to be injective it is not necessary that $g$ is injective. But as you can see from the below figure $g \,\circ\,f$ is not injective, If $g$ is not injective.
Theorem 2signifies that in order to $g \,\circ\,f$ to be surjective it is not necessary that $f$ is surjective. But as you can see from the below figure $g \,\circ\,f$ is not surjective, If $f$ is not surjective.
I'm not getting these theorems. Can anybody explain, What above theorems are trying to say.

For theorem 1, consider $A=\{1,2\}, B=\{3,4,5\}, C= \{6,7,8\}$, and now
Thus $g\circ f$ can be injective when $g$ is not.
For distinctness to be preserved on mapping $A\to C$ the mapping of $A\to B$ must preserve distinctness. However, the mapping from $B\to C$ need not preserve distinctness except among the subset of elements that is the image $f(A)$. (That is, our $g$ need not be injective if $f$ is not surjective).
Theorem 1 is that if we know that $g\circ f$ is injective, that guarantees that $f$ is injective. Other properties of $f$ and $g$ are not guaranteed by that knowledge.
Similarly for theorem 2. Consider $A=\{1,2\}, B=\{3,4,5,6\}, C= \{7,8,9\}$
So it is possible for $g\circ f$ to be surjective when $f$ is not.
Any $g\circ f$ is surjective if every element in $C$ is mapped to by an element in $A$. This requires that every element is $C$ is mapped to by some elements in $B$ of which at least one is mapped to by an element in $A$; it does not require every element in $B$ to be mapped to by an element in $A$.
So knowing that $f\circ g$ is surjective only guarantees that $g$ is surjective.