Example of nonconvex function with nonempty subgradient

63 Views Asked by At

I understand subgradient is well defined for convex functions such as $f(x)=|x|$ but not for nonconvex functions. I don't have a good intuition how subgradient is defined for a nonconvex function. Can someone please provide a simple example that subgradient does exist for a nonconvex function? I tried to search but without success. Of course somebody have asked questions involving keywords nonconvex and subgradient, but that doesn't mean the same question.