$ f(x) = \begin{cases} -1 && \text{for}-2\le x \le0\\ x-1 && \text{for } 0<x\le2 \end{cases}\\\text{Domain of }f(x) = [-2,2]\\ \text{Let there be be another function g(x),such that}\\ g(x) = f(|x|) + |f(x)| \\ $
$\text{What is function g(x)?}$
I worked the question and got $g(x) = \begin{cases} 0 & \text{for } 0<x<1 \\ -x & \text{for }-2\le x \le 0 \\ 2(x-1) & \text{for } 1\le x \le 2 \end{cases} $
Is there anything wrong with my answer?