I read the counterexample in this post, and I am wondering if it is possible to fix the statement in this way:
Given a convex function $f:\mathbb R^d\rightarrow\mathbb R\cup\{\infty\}$ and $x\in\mathbb R^d$. If $x$ has a neighborhood such that $f<\infty$, is that true that $\partial f(x)\neq\emptyset$?
Yes, this is true. Here is an outline of the proof:
The last step is the most delicate (requires some separation theorem), but should be covered in most texts on convex optimization.