Is $h(x)=\left(x^2; 1_{[0,\infty)}(x)\right)$ an injective function? 
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 ?

 A: You proof is basically correct. 


*

*For the sake of proving that $h$ is injective, you don't need to say anything about why $f$ and $g$ are not.

*I would write "let $x,y\in \mathbb{R}$ such that $h(x)=h(y)$". Writing $(x,y)\in\mathbb{R}^2$ causes confusion.

*
if $x=-y$ then $0=g(x)=g(y)=y$ or $x=g(x)=g(y)=1$ thus if
  $x=0$ 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   

This part is a little messy.  I would just write $g(x)=g(y)$ implies that either $x=y=0$ or $x$ and $y$ have the same sign. Thus $x=y$.
A: Your argument is correct, but it could be presented more clearly.

Suppose that $h(x)=h(y)$. Then $x^2=y^2$ and $g(x)=g(y)$, so in particular $x=y$ or $x=-y$. If $x=y$, we’re done, so suppose that $x=-y$ and $x\ne y$. Suppose without loss of generality that $x\le y$. Then $x\le 0\le y$, so $g(x)=0\le g(y)$, and we must have $g(x)=0=g(y)$ and hence $y=0=-y=x$. Thus, in all cases we have $x=y$, and $h$ is injective.

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:

Suppose that $x\ne y$; without loss of generality we may assume that $x<y$. If $y\le 0$, then $x^2\ne y^2$, so $h(x)\ne h(y)$. If $0\le x$, then $g(x)=x\ne y=g(y)$, so $h(x)\ne h(y)$. and if $x<0<y$, the only remaining possibility, then $g(x)=0<y=g(y)$, so $h(x)\ne h(y)$. In all cases we see that $x\ne y$ implies that $h(x)\ne h(y)$, so $h$ is injective.

