(1)Functions $\displaystyle f: \mathbb{R} \to \mathbb{R} $ and $\displaystyle g: \mathbb{R} \to \mathbb{R} $ are defined as follows:

$\displaystyle f(x) = \begin{cases} x+2\ \ \text{if}\ x<-1 \\ -x\ \ \ \text{if} -1 \leq x \leq 1 \\ x-2\ \text{if} \ \ x >1 \end{cases} $

$\displaystyle g(x) = \begin{cases} x-2\ \ \text{if}\ x<-1 \\ -x\ \ \ \text{if} -1 \leq x \leq 1 \\ x+2\ \text{if} \ \ x >1 \end{cases} $

Find functions $\displaystyle f \circ g $ and $\displaystyle g \circ f $. Is $\displaystyle g $ the inverse of $\displaystyle f $? Is $\displaystyle f $ injective or surjective? How about $\displaystyle g $?

So $\displaystyle f \circ g = x = g \circ f $ (i.e. the identity element $\displaystyle x $).

I said $\displaystyle g $ is the inverse function of $\displaystyle f $. I said $\displaystyle f $ is surjective because $\displaystyle f(-2) = f(0) $ (hence not injective). I am not sure whether $\displaystyle g $ is injective or surjective.

(2)Suppose that $\displaystyle f: X \to Y $ and $\displaystyle g: Y \to Z $ are surjections. Prove that the composite $\displaystyle g \circ f: X \to Z $ is also a surjection. So I started out by saying that $\displaystyle \forall y \in Y, \ f(x) = y \ \text{and} \ \forall z \in Z, \ g(y) = z $. Then how would I go from this to showing that $\displaystyle \forall z \in Z, \ gf(x) = z $?

(3)Let $\displaystyle f: X \to Y $ be a function. Prove that there exists a function $\displaystyle g: Y \to X $ such that $\displaystyle f \circ g = I_{y} $ if and only if $\displaystyle f $ is a surjection. So we want to prove the following: $\displaystyle f \circ g = I_{y} \Leftrightarrow $ $\displaystyle f $ is a surjection. This is equivalent to saying, from my earlier post, that a function is surjective if and only if it has a right inverse. So given that $\displaystyle f(g(x)) = y $, $\displaystyle g(x) $ points back to the domain of $\displaystyle f $. Then $\displaystyle \forall x \in X, \ y = f(x) $. Is this correct?

Thanks