I know that any local minimum $x_0$ of a (twice continuously differentiable) function $f : \mathbb{R}^n \rightarrow \mathbb{R}$ has positive semi-definite Hessian $H(x_0) \succeq 0$. Can we say moreover that there exists a neighbourhood $U$ of $x_0$ such that $$ H(x) \succeq 0 $$ for all $x \in U$? I don't see any reason for this being true since positive semi-definiteness is not a continuous property (while positive definiteness is), but can't find a counter-example.
Edit: Follow-up posted here.
No. Take$$\begin{array}{rccc}f\colon&\mathbb{R}&\longrightarrow&\mathbb R\\&x&\mapsto&\begin{cases}x^4\left(2+\sin\left(\frac1x\right)\right)&\text{ if }x\neq0\\0&\text{ otherwise.}\end{cases}\end{array}$$Then $f$ is twice differentiable, it has a local minimum at $0$ and $f''(0)=0$. But there are critical points $x_0$ of $f$ as close as you wish from $0$ such that $f''(x_0)<0$.