Exercise. Let $f: A \longrightarrow B$ be a function. Let $A_{1} \subseteq A, B_{1} \subseteq B$. Then
(1) $f\left(f^{-1}\left(B_{1}\right)\right) \subseteq B_{1}$,
(2) $f^{-1}\left(f\left(A_{1}\right)\right) \subseteq A_{1}$,
here $f\left(A_{1}\right)=\left\{f(x) \mid x \in A_{1}\right\}$.

Definition. Let $f: A \longrightarrow B$ be a function.
(1) $f$ is $1-1$ (injective) if $f\left(x_{1}\right)=f\left(x_{2}\right)$ then $x_{1}=x_{2}$. Equivalently, If $x_{1} \neq x_{2}$ then $f\left(x_{1}\right) \neq f\left(x_{2}\right)$.

(2) $f$ is onto (surjective) if $\operatorname {Im} f(=f(A))=B$.

i.e., for any $y \in B$, there exists $a \in A$ such that $f(a)=b$.
Remark-Definition. Let $f : A \rightarrow B$ be a 1-1, onto function mapping $a \longmapsto f(a)$.
We can define $f^{-1}: B \longrightarrow A$, called the inverse function of f
$b \longmapsto a$
i.e., $S_{f-1}:=\{(y, x) \in B \times A \mid f(x)=y\} \subset B \times A$.
Definition. Given two function $f: A \rightarrow B, g : B \rightarrow C$,

define $g {\circ} f: A \stackrel{f}{\rightarrow} B \stackrel{g}{\longrightarrow} C$
ie., $(g \circ f)(x)=g(f(x))$.
$S_{g{\circ} f} =\{(x, g(f(x))) \mid x \in A\} \subset\ A \times C$.
Exercise. Given two sets $A, B(\subset X)$, and a given function $f: A \rightarrow B$,

1) $f$ is 1 to 1 (injective) if and only if there exists $g: B \longrightarrow A$ such that $g \circ f=i d_{A}$.

2) $f$ is onto (surjective) if and only if there exists $g: B \longrightarrow A$ such that $f \circ g=i d_{B}$.

Pick any $p \in A$.
Define $g\left(=g_{p}\right): B \longrightarrow A$
$b \longmapsto \begin{cases}a & \\ p & \text { } \ \operatorname{}\end{cases}$
Then $g$ is well-defined, because if $b=f(a)=f(a’)$, then since $f$ is 1 to 1, $a=a’$.
Also, it is easy to see $g_{\circ} f=id_{A}$.
2) $(\rightarrow)$ Suppose $f$ is onto (Surjective).

Necessary ingredient) clarify for each $y \in B$, assign $x \in A$ such that $y=f(x)$.
$\Rightarrow$ So that we can define $g: B \rightarrow A$, $y \mapsto x$.
In fact, the existence of such a $g$ requires the “Axiom of choice”.
