I came across with the problem which asks me to show that: $f:\mathbb{R}^n\rightarrow \mathbb{R}, f\in C^2$ with Hessian of $f$ well-defined on $\mathbb{R}^n$, is convex if and only if $\nabla^2f\succeq 0$, i.e. the Hessian of $f$ is positive semi-definite.
I can prove this statement using Taylor's theorem together with the continuity of $\nabla^2 f$:
$(1)$ $\nabla^2 f\succeq 0 \implies f$ is convex is kind of trivial by Taylor's theorem: $$\forall x,y\in\mathbb{R}^n ,f(y)=f(x)+\nabla f(x)^T(y-x)+\dfrac{1}{2}(y-x)^T\nabla^2 f(\zeta)(y-x)$$ where $\zeta$ lies between the line segment connecting $x,y$. In view of $\nabla^2 f\succeq 0$ we immediately have $f(y)\geq f(x)+\nabla f(x)^T(y-x)$
$(2)$ $f$ is convex $\implies \nabla^2 f\succeq 0$:
Suppose not, i.e., $\exists x\in\mathbb{R}^n, y\in\mathbb{R}^n$ such that $(y-x)^T\nabla^2 f(x)(y-x)<0$. Since $\nabla^2f$ is continuous, we can find a neighborhood $N$ of $x$ such that $\forall \zeta\in N,$ we have $(y-x)^T\nabla^2 f(\zeta)(y-x)<0$. So we can pick $z\in N$ with $(z-x)^Tf(\zeta_{z,x})(z-x)<0$ and apply Taylor's theorem to deduce that $f(z)< f(x)+\nabla f(x)^T(z-x)$. This is a contradiction.
My question is: Since the continuity is an essential part in my proof, I wonder whether we can drop the condition $f\in C^2$ and replace it by $f\in C^1$.