Mapping is Extension iff Composite with Inclusion

Theorem
Let $S$ and $T$ be sets.

Let $A \subseteq S$.

Let $f: S \to T$ and $g: A \to T$ be mappings.

Then $f$ is an extension of $g$ iff:
 * $f = g \circ i_A$

where $i_A$ is the inclusion mapping on $A$.

Necessary Condition
Let $f: S \to T$ be an extension of $g: A \to T$.

Then by definition:

That is:
 * $f = g \circ i_A$

Sufficient Condition
Let $f = g \circ i_A$ where $i_A$ is the inclusion mapping on $A$.

Then:

So, by definition, $f$ is an extension of $g$.