Continuous Map
THE MAP GOES FORWARD, THE TEST COMES BACK
A map is not continuous or discontinuous on its own. It becomes one or the other only once two topologies have been named, one on the domain \(M\) and one on the target \(N\), and changing either can change the answer for the same map. The test runs backwards, from the target to the domain: you are handed a \(V \in \mathcal{O}_N\), you take \(\mathrm{preim}_f(V)\), and you check whether it lies in \(\mathcal{O}_M\).
The definition
Let \((M, \mathcal{O}_M)\) and \((N, \mathcal{O}_N)\) be topological spaces and let \(f : M \to N\) be a map. Write \(\mathrm{preim}_f(V)\) for the preimage of \(V \subseteq N\).
The map \(f\) is continuous with respect to \(\mathcal{O}_M\) and \(\mathcal{O}_N\) if and only if:
\[ \forall\, V \in \mathcal{O}_N, \qquad \mathrm{preim}_f(V) \in \mathcal{O}_M. \]
In words: preimages of open sets are open.
The map need not be injective or surjective: the one drawn above is neither, and it is continuous. The quantifier is where the content sits. One open set behaving well proves nothing; every open set of \(N\) has to pull back to an open set of \(M\), and a single failure anywhere in \(\mathcal{O}_N\) settles it.
Why backwards
The forwards definition is available and is a different, badly behaved property. Take \(f : \mathbb{R} \to \mathbb{R}\) with \(f(x) = x^2\), both copies carrying the standard topology: the open interval \((-1,1)\) has image \([0,1)\), which is not open. A definition that rejects squaring is measuring the wrong thing.
Pulling back does not suffer from this. A preimage puts a question to each point of \(M\) separately, so it carries union, intersection and complement across intact, where sending points forward keeps only the union. Because it commutes with unions in particular, a collection whose unions give every open set is enough to test: if each of its members pulls back to an open set, so does every union of them, and so the whole topology passes.
Both topologies, not one
Continuity is a statement about the two collections together, so the same map can be continuous against one pair and not another, and can be continuous in one direction and not the other.
Let \(M = N = \{1,2\}\) with \(f(1) = 2\) and \(f(2) = 1\), and take:
\[ \mathcal{O}_M := \big\{ \emptyset, \{1\}, \{2\}, \{1,2\} \big\}, \qquad \mathcal{O}_N := \big\{ \emptyset, \{1,2\} \big\}. \]
Checking \(f\) means working through \(\mathcal{O}_N\), which has two members. \(\mathrm{preim}_f(\emptyset) = \emptyset \in \mathcal{O}_M\), and \(\mathrm{preim}_f(\{1,2\}) = M \in \mathcal{O}_M\). Both open, so \(f\) is continuous.
Its inverse \(f^{-1} : N \to M\) obeys the same swap rule, and now the roles of the two collections are exchanged: the open sets to be pulled back are those of \(\mathcal{O}_M\), and the results must land in \(\mathcal{O}_N\). Here \(\mathrm{preim}_{f^{-1}}(\{1\}) = \{2\}\), which is not in \(\mathcal{O}_N\). So \(f^{-1}\) is not continuous.
Two cheap checks
If \(\mathcal{O}_M\) is the discrete topology, every preimage is open and \(f\) is continuous whatever \(N\) carries. If \(\mathcal{O}_N\) is the chaotic topology, only \(\emptyset\) and \(N\) need checking, and they pull back to \(\emptyset\) and \(M\), so again \(f\) is continuous.
Composition needs no work either: for continuous \(f : M \to N\) and \(h : N \to Q\) and open \(W \subseteq Q\), \(\mathrm{preim}_{h \circ f}(W) = \mathrm{preim}_f(\mathrm{preim}_h(W))\), open by applying each hypothesis once.