It is an easy to prove fact that for any function $f$ on an interval $I\subset\mathbb R$, if the oscillation of $f$ at every $x\in I$ is $<\varepsilon$, then there exists a continuous function $g$ on $I$ such that $|f(x)-g(x)|<3\varepsilon$, say, for all $x\in I$.
I'm looking for some generalization of the above in topological setting. Namely, I would like to learn in which topological spaces $X$ the following holds.
There is a quantity $\eta(\varepsilon)>0$, such that $\eta(\varepsilon)\to0$ when $\varepsilon\to0$, with the property that: for every open subset $O\subset X$, $\varepsilon>0$, and every function $f\colon O\to\mathbb R$ such that $\omega_f(x)<\varepsilon$ at all $x\in O$, there is a continuous function $g$ on $O$ such that $|f(x)-g(x)|<\eta(\varepsilon)$ for all $x\in O$.
(I feel the problem might be pretty technical, with, e.g., normality of $X$ and Tietze being used to solve it.)
Define functions $f_+$ and $f_-$ from $O\to \Bbb R$ as follows. For each $x\in O$ put $f_+(x)=\sup_{U} \inf_{y\in U} f(y)$ and $f_-(x)= \inf_{U} \sup_{y\in U} f(y)$, where $U$ ranges over all open neighborhoods of $x$. It is easy to check that the function $f_+$ is lower semicontinuous, the function $f_-$ is upper semicontinuous (see definitions below), and for each $x\in O,$ $ f(x)-\varepsilon< f_+(x)\le f(x)\le f_-(x)< f(x)+ \varepsilon.$ Thus $ f_-(x)- \varepsilon<f(x)< f_+(x)+\varepsilon$. Exercise 1.7.15.b from Ryszard Engelking’s “General Topology” (2nd ed., Heldermann, Berlin, 1989) claims that if the space $O$ is a normal then there exists a continuous function $h$ from $O$ to $\Bbb R$ such that $ f_-(x)- \varepsilon\le h(x)\le f_+(x)+\varepsilon$ for each $x\in O$. Then $f(x)-\varepsilon\le h(x)\le f(x)+\varepsilon$, so $|f(x)-h(x)|\le\varepsilon$ for each $x\in O$.