# Prove that $Uf = f$ if and only if $f$ is upper semicontinuous

Let $X$ be a metric space. $f:X \rightarrow \mathbb{R}$ is upper semicontinuous if for all $\varepsilon>0$ and all $x \in X,$ there exists an open neighbourhood $U \ni x$ such that for any $y \in U,$ we have $f(x) + \varepsilon > f(y).$

For any real-valued function $f:X\rightarrow \mathbb{R}$, we define its upper semicontinuous envelope $Uf$ as follows:

For each $x \in X,$ $Uf(x)=\inf \{ \sup_{y \in V} f(y): V \text{ is a neighbourhood of } x\}.$

Prove that for any two bounded real-valued functions $f,g$ defined on $X$, $Uf = f$ if and only if $f$ is upper semicontinuous.

My attempt: Suppose $f$ is upper semicontinuous. Clearly we have $f \leq Uf$. Suppose $f < Uf.$ For each $x \in X,$ let $\varepsilon = Uf(x) - f(x) > 0.$ By the definition of upper semicontinuity, there exists an open neighbourhood $V$ of $x$ such that for all $y \in V,$ $f(x) + \varepsilon = Uf(x) > f(y)$. This implies that $Uf(x) \geq \sup_{y \in V} f(y)$, which further implies that $Uf(x) = \sup_{y \in V}f(y).$

I do now know what's wrong with my proof. I couldn't obtain a contradiction. Also, how to prove that if $Uf=f$, then $f$ is upper semicontinuous?

• This is one direction of your proof. – Masacroso Apr 15 '17 at 16:35

First show that $Uf$ is upper semicontinuous if it is a function $\to\Bbb R$ (i.e., $Uf(x)\ne\pm \infty$ for all $x$):
Let $x\in X$, $\epsilon>0$. Then by definition of $\inf$, there exists $V\ni x$ with $\sup_{y\in V}f(y)<Uf(x)+\epsilon$. But for all $z\in V$, this $V$ is also a neighbourhood of $z$, hence for such $z$ we have $Uf(z)\le \sup_{y\in V}f(y)$ as well and hence $Uf(z)\le Uf(x)+\epsilon$.
As a consequence, if $Uf=f$ then $f$ is upper semicontinuous.
• I see. You have proven the direction if $Uf=f$, then $f$ is upper semicontinuous. How about its reverse? – Idonknow Apr 15 '17 at 16:44
• For every $V\ni x$, certainly $\sup_{y\in V}f(y)\ge f(x)$. On the other hand, 8(using thet $f$ is upper semicontinuous) for every $\epsilon>0$ there exists $V\ni x$ such that $f(y)<f(x)+\epsilon$ for all $y\in V$, i.e., $\sup_{y\in V}f(y)\le f(x)+\epsilon$. Therefore $f(x)\le Uf(x)\le f(x)+\epsilon$ for all$\epsilon>0$. – Hagen von Eitzen Apr 15 '17 at 17:02