[Math] Essential Supremum with the continuous function

real-analysis

I have a problem when I read about the Essential Supremum of a measurable function.
Let $f: E\longrightarrow \mathbb{R}$ is a measurable function respect $E$ is Lebesuge measurable set and the Lebesgue measure. Let
$$ \operatorname{ess sup} f = \inf\{z: f\leq z\;\text{almost everywhere}\}$$
We always have $\operatorname{ess sup} f \leq \sup f$, but when $f$ is continuous, why $\operatorname{ess sup} f = \sup f$?

I assume that $\operatorname{ess sup} f < \sup f = \alpha < \infty$, then exist $z$ such that $f\leq z$ almost everywhere and $z < \sup f = \alpha$, then the set $A = \{x\in E: f(x) > z\}$ is a null set, so the set $B = \{x\in E: \alpha > f(x) > z\}$ is also a null set, but $B = f^{-1}\big((z,\alpha)\big)$ is an open set in $E$. But since a set $B$ is open in $E$ if and only if exist an open set $V \subset \mathbb{R}$ such that
$$ B = V\cap E$$
Now, I can't find any contradiction?, for exmaple, if $E = \mathbb{R}$ then I have a contradiction since $B$ is open and not empty which can't be a null set. But if $E$ is a null set of $\mathbb{R}$, why is contradiction?

Best Answer

Yes, you're right, the equality

$$\operatorname{ess sup}\limits_E f = \sup_E f\tag{1}$$

does not hold for continuous functions on all (Lebesgue) measurable subsets $E \subset \mathbb{R}^n$. If $E$ is a nonempty null set, we have $\operatorname{ess sup}\limits_E f = -\infty < \sup\limits_E f$, and we can construct counterexamples to $(1)$ whenever $E$ contains a point $e$ such that $\mu(E\cap V) = 0$ for some neighbourhood $V$ of $e$. But if $E$ is such that $\mu(E\cap U) > 0$ for every open set $U$ intersecting $E$, then $(1)$ holds.

Related Question