Solution (source code)

= Solution

Define the scalar function $H(s)=\langle f(x+s(y-x)),z\rangle$ on $[0,1]$. It is <continuous> there and <differentiable> inside, with <derivative> $\langle df(x+s(y-x))(y-x),z\rangle$ by the chain rule. The one-dimensional <mean value theorem> gives $H(1)-H(0)=H'(\theta)$ for some $0<\theta<1$, proving the displayed vector-paired version. No claim of a single intermediate point giving a vector equality without pairing is required.

For the final assertion, use the scalar <mean value theorem> directly on $s\mapsto g(sh)$: it is <continuous> at $s=0$ and <differentiable> for $s>0$. Thus
$$
g(h)-g(0)=\nabla g(\theta_hh)\cdot h
$$
for some $0<\theta_h<1$. The assumed limits of all partial <derivatives> imply $\|\nabla g(x)\|\to0$ as $x\to0$, $x\ne0$. Consequently $|g(h)-g(0)|/\|h\|\le\|\nabla g(\theta_hh)\|\to0$. Hence $\boxed{dg(0)=0}$ and $g$ is <differentiable> there. This argument uses only <differentiability> on the interior of the line segment, so it does not assume the conclusion at its endpoint.