TITLE: Is this a criterion for continuity?
QUESTION [6 upvotes]: Given a topological space $(X,\tau)$ and the product space $(X^2,\tau_2)$.
Define the diagonal $\Delta X^2=\{(x,x)\,|\,x\in X\}$ and a set
$\mathbf S_\tau=\{\mathcal A\in\tau_2|\Delta X^2\subseteq\mathcal A\}$.
Then $\mathbf S_\tau$ provides some kind of $\delta$-$\epsilon$ arrangement for the elements in $X$, since one can formulate conditions as $\forall\mathcal A\in\mathbf S: (x,y)\in \mathcal A$, which asserts that $(x,y)$ is "close to the diagonal" and therefore that $x$ "is close to" $y$.
Suppose $f:X\to X'$ is a function between topological spaces, then the question is
If
$\forall x\in \!X\,\forall \mathcal E'\!\in \mathbf S'\,\exists\mathcal D\in\mathbf
S\,\forall y\in \!X: [(x,y)\in\mathcal D\implies(f(x),f(y))\in\mathcal E']$
then $f$ is continuous?
If not, perhaps under the condition that the spaces $X,X'$ are Hausdorff?

REPLY [5 votes]: Given a subset of $A\subseteq X\times X$, let $A_x$ denote the slice
$$ A_x = \{ y\in Y \,|\, (x,y)\in A\}.$$
We have an embedding $i_x\colon X\to X\times X$ given by $y\mapsto(x,y)$, which allows us to express $A_x$ as $i_x^{-1}(A)$.
For $$\mathbf S = \left\{\, A\subseteq X\times X \,\middle|\, \text{$A$ is open, containing $\Delta$}\,\right\}$$
I claim that that $(A_x)_{A\in\mathbf S}$ are open sets in $X$ containing $x$ and provided $X$ is $T_1$, all open sets containing $x$ are of this kind. Let $A\in\mathbf S$, then $A_x=i_x^{-1}(A)$ is open, since $A$ is open, and $x\in A_x$, since $A$ contains the diagonal. Conversely, let $B\subseteq X$ be an open set containing $x$ and for every $z\neq x$ let $U_z$ be an open neighborhood of $z$ with $x\notin U_z$, then
$$
A = (B\times B) \cup \bigcup_{z\neq x} (U_z\times U_z)
$$
is open, contains the diagonal and satisfies $A_x=B$.
Since your statement boils down to
$$\;\forall x\in \!X\,\forall \mathcal E'\!\in \mathbf S'\,\exists\mathcal D\in\mathbf
S\colon \mathcal D_x \subseteq \mathcal f^{-1}(\mathcal E'_{f(x)}),$$
this becomes the neighborhood-definition of continuity, provided $X$ and $X'$ are $T_1$.