Let h defined by : $$\begin{align} h \ \colon\ \mathbb{R} & \to \mathbb{R}^{2} \\ x & \mapsto h(x)=\biggl(f(x);g(x)\biggr). \end{align}$$ and $$\begin{align} f \ \colon\ \mathbb{R} & \to \mathbb{R}^{+} \\ x & \mapsto x^{2}. \end{align}$$ $$\begin{align} g \ \colon\ \mathbb{R} & \to \mathbb{R} \\ x & \mapsto g(x)=\begin{cases} 0 &\text{if}~x<0\\ x &\text{if}~x\geq 0\end{cases}. \end{align}$$
- I would like to prove that $h$ injective function even $f$ and $g$ aren't ?
Indeed,
- since $f(-1)=f(1)$ and $g(1)=g(2)$ then f and g are not injectives
- let $(x,y)\in \mathbb{R}^{2}$ such that $h(x)=h(y)$
we've $h(x)=h(y)\iff \begin{cases} x^2=y^2 & \\ g(x)=g(y) & \end{cases} \iff \begin{cases} x=y \text{ or } x=-y & \\ g(x)=g(y) & \end{cases}$
- if $x=-y$ then $0=g(x)=g(y)=y$ or $x=g(x)=g(y)=1$ thus if $x=O$ then $x=y=0$ if $y=0$ then $x=y=0$ thus in any case we will have $x=y$ which means that $h$ is injective function
- Is my proof correct ? is there other ways ?
Your argument is correct, but it could be presented more clearly.
It rarely hurts to more rather than less of the logical ‘connective tissue’ that makes the flow of the argument clearer.
You can also prove in other ways. For instance: