Plot and calculate subgradient of f(x)

163 Views Asked by At

I want to calculate the subgradient of $$f(x) = \begin{cases} 0& |x|\le 1\\ |x|-1& 1<|x|\le2\\ +\infty& x > 2 \end{cases}$$

but I do not know how to start and want to plot $f(x)$ first. Then, I think it is easier to imagine? Do you admit with me or should I start different?