How to find the subgradients of $f(x)=\|x\|^2-1$ if $\|x\|\geq 1$, $f(x)=0$ if $\|x\|\leq 1$, $x\in\mathbb{R}^2$.
By definition a subgradient $a$ must satisfy $f(x+y)\geq f(x)+a\cdot y$
I just have problems in the case $\|x\|=1$, when $\|x+y\|\leq 1$.
In this case $a$ must satisfy
$0\geq a\cdot y$, for all $y$ such that $\|x+y||\ \leq 1$ or $\|x+y||\ ^2 \leq 1$.
$0\geq a\cdot y\Rightarrow0\geq \|a\|\|y\|cos\theta_{ay}\Rightarrow0\geq cos\theta_{ay}\space\forall y$ such that $\|x+y||\ \leq 1$
I drew that condition and then the solution is $a=\lambda x,\lambda \geq 0$
But I dont know how to justify it.