(5) $f(x) = |x|$.
4.2. Let $f: X \rightarrow Y$ be a function from a set X to a set Y. Show that
(1) f is injective if and only if f has a left inverse $g: Y \rightarrow X$ such that $g \circ f =$
$id_X$, the identity function on X,
(2) f is surjective if and only if f has a right inverse $g: Y \rightarrow X$ such that
$f \circ g = id_Y$, the identity function on Y,
(3) f is bijective if and only if f has a two-sided inverse $g: Y \rightarrow X$ such that
$g \circ f = id_X$ and $f \circ g = id_Y$.