With \(X=\{1,2,3\}\), \(\mathcal{T}_X=\{\varnothing,\{1\},\{1,2\},X\}\) and \(Y=\{a,b\}\), \(\mathcal{T}_Y=\{\varnothing,\{a\},Y\}\), how many functions \(X\to Y\) are continuous?
The function is determined by \(f^{-1}(\{a\})\), which must be open in \(X\): \(\varnothing\), \(\{1\}\), \(\{1,2\}\) or \(X\). Each gives a different continuous function, so there are \(4\).
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\).