Points of continuity is a Borel set?

If $f:X\to Y$ where $X$ is a topological space and $Y$ is a metric space, then the set of points of continuity of $f$ is the $G_\delta$ set $$\bigcap_{n=1}^\infty\bigcup\left\{D\subseteq X:D\text{ is open and }\operatorname{diam}f[D]\le\frac1n\right\}.$$


Hints: Let $g_n(x)=\sup \{|f(x)-f(y)|: d(y,x) <\frac 1 n\}$ and $g(x)=\inf_n g_n(x)$ Then $\{x:g(x) <t\}$ is open for all $t$ so $g$ is Borel measurable. Also $f$ is continuous at $x$ iff $g(x)=0$. Hence the points of continuity is always a Borel set (in fact a $G_{\delta}$ set). Separability is not needed.

[ Suppose $g(x) <t$. $g(x) <s<t$. Let Then there exists $n$ such that $g_n(x) <t$. Hence $|f(x)-f(y)| <s$ whenever $d(y,x) <\frac 1 n$. Now check that $d(x',x) <\frac 1 {2n}$ implies $|f(x')-f(y)| <s$ whenever $d(y,x') <\frac 1 {2n}$. Take sup over $y$.This proves that $\{x:g(x) <t\}$ is open].