Question:
Give examples of two functions $f: N \rightarrow Z$ and $g: Z \rightarrow Z$, such that $g$ of is injective but $g$ is not injective.
Solution:
Let $f: N \rightarrow Z$ be given by $f(x)=x$, which is injective.
(If we take f(x) = f(y), then it gives x = y)
Let $g: Z \rightarrow Z$ be given by $g(x)=|x|$, which is not injective.
If we take $f(x)=f(y)$, we get:
$|x|=|y|$
$\Rightarrow x=\pm y$
Now, gof: $N \rightarrow Z$.
$(g \circ f)(x)=g(f(x))=g(x)=|x|$
Let us take two elements x and y in the domain of gof , such that
$(g \circ f)(x)=(g \circ f)(y)$
$\Rightarrow|x|=|y|$
$\Rightarrow x=y(\mathrm{We}$ don't get $\pm$ here because $\mathrm{x}, \mathrm{y} \in \mathrm{N})$
So, gof is injective.