Extension of bounded convex function to boundary
Suppose $U$ is a convex open set in $\mathbb R^n$, and $f$ is a bounded convex function on $U$. $f$ is then automatically continuous on $U$.
The question is: Can we always extend $f$ continuously to $\bar{U}$?
I know boundedness of $f$ is necessary, otherwise we can construct $g=1/[x-x^2]$ on unit open interval. Boundedness of $f$ is also sufficient in one dimensional case. If the extension in general exists, the only reasonable way to construct it is via:
find a fixed point $x_0$ in $U$; for each point x on $\partial U$, consider the line $L$ joining $x_0$ and $x$; $f$ restricting on $L \cap U$ is convex; we do the extension in this one dimensional case.
But I can not prove the continuity of the extended function, nor can I prove the extension is irrelevant to choice of $x_0$. I know $f$ is locally Lipschitz; perhaps it can help in some way.
This is false in general. There exists a convex function $f$ on the open upper halfdisk $U=\{(x,y): x^2+y^2<1,\ y>0\}$ such that $0\le f\le 1$ everywhere, $f(x,y)\to 0$ as $(x,y)$ converges to the diameter (except endpoints), and $f(x,y)\to 1$ as $(x,y)$ converges to semicircle (except endpoints). There is no limit as $(x,y)\to (\pm 1,0)$.
Example: Let $$f(x,y) = \sup_{0<t<\pi} \frac{x\cos t+y\sin t-|\cos t|}{1-|\cos t|} \tag{1}$$
Motivation: this has the same effect as taking the supremum over all affine functions that are $\le 0$ on the diameter and $\le 1$ on the halfcircle. I wish I had an example with a simple closed-form expression. But at least this one is concrete enough to obtain a plot numerically:
To prove that it works, observe that for $(x,y)\in U$:
- $f(x,y)\le 1$ since $x\cos t+y\sin t\le 1$
- $f(x,y)\ge y$ since for $t=\pi/2$ the quotient in $(1)$ is $y$
- $f$ is convex, being the supremum of a family of affine functions.
- For any fixed $\theta\in(0,\pi)$, $$\lim_{r\uparrow 1}f(r\cos\theta,r\sin\theta)= 1$$ because the choice $t=\theta$ yields $f(r\cos\theta,r\sin\theta)\ge \frac{r-|\cos\theta|}{1-|\cos \theta|}\to 1$.
- For any fixed $x\in(-1,1)$,
$$\lim_{y\downarrow 0}f(x,y )= 0$$
Indeed, pick $r\in (|x|,1)$ and consider the subdomain where $|x|+y<r$. The supremum in $(1)$ is in effect only over $t$ such that $|\cos t|\le r$; otherwise the quotient is negative. So,
$$\frac{x\cos t+y\sin t-|\cos t|}{1-|\cos t|} \le \frac{ y\sin t }{1-|\cos t|} \le \frac{y}{1-r}$$ proving the claim.
By constructing a counterexample for a different problem, I encountered an explicit function which can serve as a counterexample here.
On $$D = \{(x,y) \in \mathbb{R}^2 : x^2 < y\}$$ consider the function $$f(x,y) = \frac{x^2}{y}.$$ On $D$, $f$ takes values in the interval $(0,1)$.
We can extend $f$ continuously to $\bar D \setminus \{(0,0)\}$ and have $f(0,y) = 0$, $y > 0$, and $f(x,x^2) = 1$, $x > 0$. Hence, it does not extend continuously to $(0,0)$.
Similarly to Normal Human's example, the epigraph of this function is the convex hull of $\{(x,x^2,1), x \in \mathbb{R}\} \cup \{(0,y,0), y \in \mathbb{R}\}$.
Edit: Here is an image (upside down):