(related to Chapter: Continuity)
The identity function $id:X\to X$ on any given topological space $(X,\mathcal O)$ is continuous.
If $(X,\mathcal O_X)$ and $(Y,\mathcal O_Y)$ are topological spaces, then the constant function $f:X\to Y$, $f(x)=y\in Y$ for all $x\in X$ is continuous, since for an $B\subseteq Y$ we have * either $f^{-1}[B]=\emptyset,$ if $y\not\in B,$ * or $f^{-1}[B]=X,$ if $y\in B.$
Both, $\emptyset$ and $X$ are open in $X$ by definition of topological space.
Consider $(X,\mathcal O_X)$ and $(Y,\mathcal O_Y)$ as topological spaces. The continuity of $f:X\to Y$ depends on both topologies, $\mathcal O_X$ and $\mathcal O_Y.$ For instance:
If $f:X\to Y$ is a continuous function defined on two topological spaces $(X,\mathcal O_X)$ and $(Y,\mathcal O_Y)$, then $f$ remains continuous if we replace the topology $\mathcal O_X$ by a finer one, and the topology $\mathcal O_Y$ by a coarser one.