Let \(X=\{1,2,3\}\) with \(\mathcal{T}=\{\varnothing,\{1\},\{1,2\},\{1,2,3\}\}\) and \(Y=\{a,b\}\) with \(\mathcal{T}=\{\varnothing,\{a\},\{a,b\}\}\). Which function \(f:X\to Y\) is continuous?
It suffices that the preimage of each proper open set of \(Y\) be open in \(X\). For the correct one: \(f^{-1}(\{a\})=\{1,2\}\), all open. By contrast, for \(f(1)=a,\ f(2)=b,\ f(3)=a\) we get \(f^{-1}(\{a\})=\{1,3\}\), which is not open.
A function \(f:X\to Y\) between topological spaces \((X,\mathcal{T}_X)\) and \((Y,\mathcal{T}_Y)\) is continuous if the preimage of every open set \(V\) of \(Y\) is an open set of \(X\).