If $f$ is differentiable in $\vec{x_0}$ and $f$ reaches a local maximum in $x_0$ then $\nabla f(\vec{x_0})=\vec{0}$
Proof:
Let $g:\mathbb{R}\rightarrow \mathbb{R}^n$ defined by $g(t)=\vec{x_o}+t\vec{v}$ and let $B=(f\circ g)$.
As $f$ reaches a local maximun in $\vec{x_0}$ then $B$ reaches the maximum in $t=0$.
This implies:
$$B(\vec{0})=(f\circ g)(\vec{0})=f(g(\vec{0}))\implies \vec{0}=B'(\vec{0})=f'(g(\vec{0}))g'(\vec{0})=D_\vec{v}f(g(\vec{0}))=D_\vec{v}f(\vec{x_0})= \langle\nabla f(\vec{x_0}),\vec{v}\rangle$$
I don't understand this line:
$$f'(g(\vec{0}))g'(\vec{0})=D_\vec{v}f(g(\vec{0}))=D_\vec{v}f(\vec{x_0})= \langle\nabla f(\vec{x_0}),\vec{v}\rangle$$
As $v$ is arbitrary, then $\nabla f(\vec{x_0})=\vec{0}$
Can someone explaint that step? Thanks!
This is because, given a scalar product $b$, $b(u,v)=0$ for every $v$ implies that $b(u,u)=0$ implies $u=0$, (positive definite).