Suppose $(X,d)$ is a metric space and a real-valued function $f$. Denote the oscillation of $f$ restricted to a closed subset $F \subseteq X$ at a point $x \in F$ by $$oscf|_{F}(x)=\inf_{U \ni x \space open} \sup \{ d(f(x_1), f(x_2)):x_1,x_2\in U \cap F \}$$
Claim: $oscf|_{F}$ is upper semicontinuous.
Definition: $oscf|_{F}:X\rightarrow \mathbb{R}$ is upper semicontinuous if for all real number $c$, the set $\{ x \in X: oscf|_{F}(x) < c \}$ is open in $X$.
My attempt: Let a real number $c$ be given and $oscf|_{F}(y) <c.$ By definition of infimum, there exists an open neighourhood $U$ of $y$ such that $\sup \{ d(f(x_1), f(x_2):x_1,x_2 \in U\cap F \} <c$. If $z \in U\cap F$, then $U$ is an open neighbourhood of $z$. Therefore $oscf|_{F}(z) <c.$ Hence, $U \cap F \subseteq \{ x \in F: oscf|_{F}(x) < c\}$ and $U \cap F$ is open in $F$. So the set $\{ x \in F: oscf|_{F}(x) < c\}$ is open in $F$ and $oscf|_{F}$ is upper semicontinuous.
Is my proof correct?