Is a convex function always continuous?

Corollary 10.1.1 of Convex Analysis by Rockafellar says all convex functions from $\mathbb R^{n}$ to $\mathbb R$ are continuous. The proof is very long and it is not worth reproducing the complete proof here. In the infinite dimensional case there are are discontinuous linear functionals.


No: all convex functions $f: \mathbb R^2 \to \mathbb R$ are continuous.

Here's a slightly more general statement. Let $f : \mathbb R^n \to \mathbb R$ be a convex function, and let $\mathbf x^* \in \mathbb R^n$. We show that $f$ is continuous at $\mathbf x^*$.

Let $S = \{\mathbf y \in \mathbb R^n : \|\mathbf x^* - \mathbf y\| = 1\}$. Our first goal is to show that there's some $M\in \mathbb R$ such that $f(\mathbf y)\le M$ for all $\mathbf y \in S$.

To prove that $M$ exists: by Jensen's inequality, if $\mathbf x^{(1)}, \dots, \mathbf x^{(m)}$ are arbitrary points in $\mathbb R^n$, and $\mathbf x$ is a point in their convex hull, then $f(\mathbf x)$ is a weighted average of $f(\mathbf x^{(1)}), \dots, f(\mathbf x^{(m)})$, so it is bounded above by $\max\{f(\mathbf x^{(1)}), \dots, f(\mathbf x^{(m)})\}$. From there, it's enough to find finitely many points whose convex hull contains $S$: for example, the vertices of a hypercube circumscribed about $S$.

Now suppose we take some $\mathbf x$ close to $\mathbf x^*$. Let $r = \|\mathbf x^* - \mathbf x\|$; we may assume $r<1$, since ultimately we want to consider $\|\mathbf x^* - \mathbf x\|$ arbitrarily small.

On the line through $\mathbf x$ and $\mathbf x^*$, we can pick points $\mathbf y^-, \mathbf y^+ \in S$ such that they appear in the order $\mathbf y^-, \mathbf x^*, \mathbf x, \mathbf y^+$ on that line. They can be defined by: $$ \mathbf y^- = \mathbf x^* - \frac{\mathbf x - \mathbf x^*}{r} \text{ and } \mathbf y^+ = \mathbf x^* + \frac{\mathbf x - \mathbf x^*}{r}. $$ From this, we have

  • $\mathbf x^* = \frac{r}{r+1} \mathbf y^- + \frac{1}{r+1} \mathbf x$, so $f(\mathbf x^*) \le \frac{r}{r+1} f(\mathbf y^-) + \frac{1}{r+1} f(\mathbf x)$, which gives us the lower bound $$f(\mathbf x) - f(\mathbf x^*) \ge r f(\mathbf x^*) - r f(\mathbf y^-) \ge r(f(\mathbf x^*) - M).$$
  • $\mathbf x = r \mathbf y^+ + (1-r) \mathbf x^*$, so $f(\mathbf x) \le r f(\mathbf y^+) + (1-r)f(\mathbf x^*)$, which gives us the upper bound $$f(\mathbf x) - f(\mathbf x^*) \le r f(\mathbf y^+) - r f(\mathbf x^*) \le r(M - f(\mathbf x^*)).$$

Putting these together, we get $$ -r(M - f(\mathbf x^*)) \le f(\mathbf x) - f(\mathbf x^*) \le r(M - f(\mathbf x^*)) $$ which is the statement we need to prove continuity. (In the usual $\epsilon$-$\delta$ form: given $\epsilon > 0$, take $\delta = \frac{\epsilon}{M - f(\mathbf x^*)}$. Then if $\|\mathbf x^* - \mathbf x\| < \delta$, the inequalities above tell us that $|f(\mathbf x^*) - f(\mathbf x)| < \epsilon$.)


Yes, if $E$ is an infinite-dimensional real Banach space then a discontinuous linear functional is a discontinuous convex function. But the map $f$ defined by $f(u)=\sum u_i/i$ is certainly continuous on $\ell_2$.

You're not going to be able to write down a formula for a discontinuous linear functional on a Banach space - it takes the Axiom of Choice to show such a thing exists.