I am trying to solve this exercise from Royden's 3rd edition.
The question is as follows: Let $f$ be a real-valued function defined for all real numbers. Show that the set of points at which $f$ is continuous is a $G_{\delta}$.
Let $$A_n = \{y : \text{there is a }~\delta_y \gt 0 : |f(s)-f(t)|\lt 1/n ~ \text{whenever}~ s,t \in (y-\delta, y+\delta)\}\;.$$
Then by the definition of open sets, $A_n$ is open.
To complete the proof, I need help in showing that $f$ is continuous at say $x$ if and only if $x\in \cap A_n$.
If $f$ is continuous at $x$, there is a $\delta \gt 0$ such that $|f(x) - f(a)| \lt 1/n$ whenever, $x\in (a-\delta, a+\delta)$, so $x \in A_n$, so it must be in $\cap A_n$.
Thanks.