# Composition of functions help (Injection and Surjection)

I can't seem to wrap my head around writing a function as the composition of two other functions under the constraint that one of the functions must be injective and the other must be surjective. $f:\mathbb{R} \to \mathbb{R}$

I am trying to write: \begin{align} f(x) = |x| + 1\\ \end{align} I know \begin{align} \sqrt[]{x^2} \end{align} is equivalent to |x|, but this function is not injective or surjective, so I believe my best option is to add a term of x to this to make it one of either, for example adding x for injective or x^3 for surjective. I have no idea where to go from here.

I am really looking for general advice so I can tackle these problems as they come.

-
Any information about what the domain and range have to be? or do both have to be from R->R? – Sun Oct 10 '13 at 14:15
Yes sorry, both from R->R. I will edit that in. @Sun – Display Name Oct 10 '13 at 14:17
No what I meant was, you want to write $f$ as $g \circ h$, right? Are both $g$ and $h$ defined as surjective or injective on $\mathbb{R} \rightarrow \mathbb{R}$ or can we choose the sets where they are defined? – Sun Oct 10 '13 at 14:24
You have to define the set you're targeting when defining a surjective function. Surjective on what? On $\mathbb{R}$ or on $[1,\infty)$ ? And does the order matter? There is no surjective function to $\mathbb{R}$ which only has values from the set $[1,\infty)$ you know. – Zafer Sernikli Oct 10 '13 at 14:26
Yes f as g(h(x)) with g and h both on $\mathbb{R}$→$\mathbb{R}$ with one being surjective and one being injective.Sorry for ambiguity!! @Sun – Display Name Oct 10 '13 at 14:28

Consider a composition $f = h \circ g$. Also, there exists a bijection $k$ between $\mathbb{R}^{+} \rightarrow \mathbb{R}$ - there are many ways to construct one. One example is to make $[0 \quad 1]$ map to $[-1 \quad 1]$ and similarly extend. Let $g = k(|x|)$. This is a surjection. Now, $h = k^{-1} + 1$. It is defined from $\mathbb{R} \rightarrow [1,\infty)$ and bijective there, but when the range is embedded within $\mathbb{R}$ , $h$ is injective.