Doubt on piecewise function

39 Views Asked by At

Suppose we have a function given by:

$f(x)= \begin{cases} x & x < 0\\ x+1 & x \ge 0 \end{cases}$

Then

$f(|x|)= \begin{cases} |x| & x < 0 \\ |x|+1 & x \ge 0\end{cases}$

Or

$f(|x|)= \begin{cases} |x| & |x|<0\\ |x|+1 & |x|\ge0 \end{cases}$

I.e. $f(|x|)= |x|+1$ as $|x|$ is not $<0$.

Please tell me which one is correct and why?

1

There are 1 best solutions below

7
On

For every $x\in \mathbb R$, we have $$|x|\geq 0$$

Hence, by very definition of $f$, we must have $$f(|x|)=|x|+1$$ for every $x\in \mathbb R$.