Assume that $f$ is a differentiable $\mathbb{R}$-valued function defined on an open subset of $\mathbb{R}^n$.
Question: If $f$ has a unique global minimum, which is also a unique local minimum, does that imply $f$ is (strictly) convex?
What are the minimal necessary and sufficient (continuous) differentiability conditions for this to be true? Is being once continuously differentiable necessary and sufficient?
Background: Existence of a unique local minimum does not imply existence of any global minimum, consider e.g. $f(x,y) = x^2 + y^2(1+x)^3$. That function is not convex, and I was wondering whether or not that was a coincidence.
I know that necessary regularity conditions for convex functions are more complicated if one considers boundary points, e.g. a convex function only has to be continuous or locally Lipschitz on the interior of its domain. Since the counterexamples involving boundary points confuse me, that is why I decided to limit my question to convex functions defined on an open subset.
If we restrict to functions defined on open sets, it is clear that we need at least continuity, since any real-valued convex function is continuous on the interior of its domain of definition.
It is also clear that one can have functions with a unique global minimum which are not convex, as long as that global minimum is not also a unique local minimum. Consider as an example $$f:x \mapsto x^2 \left(|\cos(x) + 1 + \epsilon|\right) \quad \text{for any }\epsilon > 0 \,.$$
It was less clear to me whether continuity was sufficient. However, a counterexample is given (implicitly) in this answer; $f: x \mapsto \sqrt{|x|}$ has a unique global minimum at $x=0$, a unique local minimum at $x=0$, is continuous, but it is not convex.
That same answer argues that (twice) continuous differentiability would be enough to imply $f$ is locally convex at that point. To be honest I am not sure if, even when we are assuming the point to be both a unique local and global minimum, this implies that the function must be globally convex, even in the univariate case. Even assuming continuous differentiability in the univariate case, all that is clear to me is that the first derivative must be positive in a neighborhood of the point and afterwards remain non-negative -- presumably the second derivative can do whatever it wants as long as it doesn't conflict with the above requirement on the first derivative, in particular it would seem that the second derivative could be negative on some intervals and thus the function not convex there. My knowledge and intuition both fail me entirely for the multivariate case.
This isn't a duplicate, because the more common question assumes that $f$ is convex and wants to conclude the assumptions I've made -- what I am interested in is the converse. This also isn't a homework problem, I am just curious and trying to develop some intuition for how regular an objective function needs to be in order for being strictly convex to "be the same thing as" the property of having a unique local and global minimum.