Result of applying an 'if' dependant function on itself?

42 Views Asked by At

I have this function $$h(x)=\begin{cases}1 & \text{if } x \geq 0 \\ 0 & \text{if } x < 0 \end{cases}$$ and I was wondering if I apply this function to itself $h \circ h$, can I just say the resulting function would be $h$? Seeing as they are both dependent on passing the same 'if' statement. If not, could you please help steer me in the right path? Thanks.

1

There are 1 best solutions below

1
On

$$ h(h(x)) = \begin{cases} 1 & \text{ if } h(x) \geq 0\\ 0 & \text{ if } h(x) < 0 \end{cases} $$ But $h(x)$ is never negative. Thus the second case does not occur, which means $h(h(x))=1$ for all $x$.