Let $f(x)$ be a real value function defined by $f(x)=x^2-2|x|$. If
$g(x)$$ = \begin{cases} { \mbox{minimum}: f(t): -2 \le t \le x, x \in [-2,0) \\[2ex] \mbox{maximum} : f(t) : x \le t \le 2, x \in [0,2] } \end{cases}$
I'm not sure how I should plot this. The answer of the plot shows $f(x)$ for $-2$ to $-1$ and $1$ to $2$. It is equal to $-1$ between $-1$ and $0$. And it is equal to $0$ from $0$ to $1$.
Steps:
Here is what the graph of $f$ looks like:
Now, exercise:
Show that $$ g(x)=\begin{cases} f(x),& x\in[-2,-1]\\ -1,&x\in (-1,0)\\ 0,& x\in[0,2]. \end{cases} $$