Let $\Omega\subset \mathbb R^n$ be a connected open set and $f\in C_0(\Omega,(-\infty,0))$ be a locally convex function, i.e. for any $x\in\Omega$ there exists a neighborhood $U(x)$ where $f$ is convex. Does it imply that $\Omega$ is convex?
I want to motivate my question a little: The sublevels of a convex functions are convex. So one could consider to characterize convex sets as sublevels of convex functions, i.e. to say a convex set $\Omega$ is characterized by (the existence of) a convex exhaustion function $f\in C_0(\Omega,(-\infty,0))$. This is relatively trivial, because a convex function can always be extended convexly to the convex envelope of its domain (or even to R^n if one allows the values $\pm \infty$). The question gets more interesting, if one assumes only local convexity of $f$. Local convexity is a "natural" condition if one comes from PDE theory, because a $C^2$ function is locally convex if and only if its Hessian is positive semidefinite. Consequently, the notion of locally convex functions appears e.g. in Trudinger, Wang "Hessian measures I" (page 1: "n-convex functions are convex") or enter link description here (page 6: "When k = n, it is equivalent to the usual convexity."), and in both papers, convexity is mistaken for local convexity. In contrast to a convex exhaustion function, it is not so easy to see that a locally convex exhaustion function always lives on a convex domain.