For bounded real valued function $f$ show that $\omega_f$ is upper continuous

Let $f:X\to\Bbb R$ be bounded, where $X$ is a metric space. Let the function

$$\omega_f(x):=\inf_\epsilon \omega_f(x,\epsilon)=\lim_{\epsilon\to 0^+}\omega_f(x,\epsilon)\tag{1}$$

where $$\omega_f(x,\epsilon):=\sup \{|f(z)-f(y)|:z,y\in \Bbb B(x,\epsilon)\}\tag{2}$$ And a function is upper continuous when

$$f(a)\ge \limsup f(x_n),\text{ whenever }(x_n)\to a\tag{3}$$

for all $a\in{\rm dom}(f)$. An equivalent definition for $(3)$ is: for any $\epsilon>0$ exists some $\delta>0$ such that

$$x\in\Bbb B(a,\delta)\implies f(x)-f(a)<\epsilon\tag{4}$$

Check this proof please. For this proof I will use a functional definition of limit superior:

$$\limsup_{x\to a}f(x)=\inf_\epsilon\sup f(\Bbb B(a,\epsilon)\setminus\{a\})=\lim_{\epsilon\to 0^+}\sup f(\Bbb B(a,\epsilon)\setminus\{a\})\tag{5}$$

noticing that $(5)$ imply the sequential definition of $\limsup$ for any sequence $(x_n)\to a$, in the same way that the functional definition of limit imply the sequential definition of limit for any sequence that converges to the limit point of the domain.

Writing $(5)$ in an $\epsilon{-}\delta$ form we can says that if $L=\limsup_{x\to a}f(x)$ then for any $\epsilon>0$ exists a $\delta>0$ such that

$$|\sup f(\Bbb B(a,\delta)\setminus\{a\})-L|<\epsilon\tag{6}$$

Hence from $(6)$ and $(4)$ we can write

$$\sup\omega_f(\Bbb B(a,\delta)\setminus\{a\})<\epsilon+L\tag{7}$$

And from $(5)$ we can write $L$ as

$$L=\inf_\delta\sup \omega_f(\Bbb B(a,\delta)\setminus\{a\})\tag{8}$$

Now, using the definitions above, observe that

$$\begin{align}L&\le \inf_\delta\sup \omega_f(\Bbb B(a,\delta)),&\text{from }(8)\\&=\inf_\delta\sup\{\omega_f(x):x\in\Bbb B(a,\delta)\}\\&\le\inf_\delta\sup\{|f(y)-f(z)|:y,z\in\Bbb B(a,\delta)\},&\text{from }(1)\text{ and }(2)\\&=\omega_f(a)\end{align}$$

Then from above and $(7)$ we finally have that

$$\bbox[border:2px solid gold,8pt]{\forall\epsilon>0,\exists\delta>0:\sup\omega_f(\Bbb B(a,\delta)\setminus\{a\})<\epsilon+\omega_f(a)}\tag{9}$$

what is equivalent to $(4)$, that is

$$\forall\epsilon>0,\exists\delta>0:x\in\Bbb B(a,\delta)\implies\omega_f(x)<\epsilon+\omega_f(a)$$

Solutions Collecting From Web of "For bounded real valued function $f$ show that $\omega_f$ is upper continuous"