Properties of oscillation Let $(X,\tau)$ be a topological space, $(M,\operatorname{d})$ a metric space and $f:X \to M$. Then

Definition:
The oscillation of $f$ at $x \in X$ is
$$ \omega_f(x) = \inf_{x \in U \in \tau} \operatorname{diam}(f[U])$$

There are two theorems that I am trying to prove. They are generalisations of some other theorems known to be true


*

*For any $\eta > 0$, $\{x\mid \omega_f(x) < \eta\} \in \tau$


*$f$ is continuous(open preimages for open sets) iff its oscillation is $0$.

It seems like that (1) could be proved using the fact that preimage preserves subsets, but I don't know how to show (2). Are they true or there are counterexamples?
 A: For (1), if $\omega_f(x)<\eta$, then there is some open neighborhood $U$ of $x$ such that $f[U]$ has diameter $<\eta$.  For any $y\in U$, we then also have $\omega_f(y)<\eta$ because $U$ is also a neighborhood of $y$.  So $U$ is a neighborhood of $x$ contained in $\{x\mid\omega_f(x)<\eta\}$.  Since $x$ was arbitrary, this means $\{x\mid\omega_f(x)<\eta\}$ is open.
For (2), $f$ is continuous at $x$ iff for all $\epsilon>0$ there is a neighborhood $U$ of $x$ such that $f[U]$ is contained in the ball of radius $\epsilon$ around $f(x)$.  Since that ball has diameter $\leq 2\epsilon$, this means $\omega_f(x)\leq 2\epsilon$.  Since $\epsilon$ is arbitrary, this means $\omega_f(x)=0$.  Conversely, if $\omega_f(x)=0$, then for all $\epsilon>0$, there is an open neighborhood $U$ of $x$ such that $f[U]$ has diameter $<\epsilon$.  Since $f(x)\in f[U]$, this means $f[U]$ is contained in the ball of radius $\epsilon$ around $f(x)$.  Since $\epsilon$ is arbitrary, this means $f$ is continuous at $x$.
