Functorial modifications of a topology Let $S$ be a set. Then there are only two ways to attach
functorialy a topology $\mathcal{T(S)}$ to it: The discrete and the trivial topology. Functorial means in this case that all maps $f \colon S \to S$ are continuous with respect to $\mathcal{T}(S)$.
Now, let $X$ be a topological space with topology $\mathcal{T}(X)$. What topologies $\mathcal{T}'(X)$ can be attached to $X$ in a functorial way, i.e. such that all continuous maps $X \to X$ for $\mathcal{T}(X)$ are continuous for $\mathcal{T}'(X)$?
More generally, what are the endofunctors $\mathcal{Top} \to \mathcal{Top}$ of the category of topological spaces that fix the underlying set of the objects and the morphisms (as maps of sets)? In other words, what are the endofunctors of $\mathcal{Top}$ that are functors over the forgetful functor $\mathcal{Top} \to \mathcal{Set}$?
A proof for the statement in the beginning: Assume $\mathcal{T}(S)$ is not the trivial topology. Then there is a nonempty proper open subset $U \subset S$. Fix two points $x_1 \in U$, $x_2 \in S \setminus U$. For
an arbitrary set $V \subset S$, consider the "characteristic function" $f_V$:
$$f_V \colon S \to S$$
$$f_V(x) = \begin{cases}x_1 & x \in V \\ x_2 & x \not \in V \end{cases} $$
Because all functions $S \to S$ are continuous, $f_V$ is continuous, and $f_V^{-1}(U)=V$ is open. Because $V$ was arbitrary, every subset of $S$ is open, i.e. the topology is discrete.
 A: Let $\mathcal C$ be a class of spaces. Call a continuous map $t:C\to X$ from a space $C\in\mathcal C$ to $X$ a test map. Then we can equip $X$ with the final topology with respect to all test maps to $X$ and call this new space $cX$, so a set $A$ in $cX$ is closed if and only if $t^{-1}(A)$ is closed for every test map $t$. Note that the test maps to $cX$ and those to $X$ are the same.
A space $X$ which already has the final topology for all its test maps will be called a $c$-space. These $c$-spaces and all continuous maps between them form a subcategory $c\mathbf{Top}$ of $\mathbf{Top}$.
Now given a map $f$ from a $c$-space $X$ to a space $Y$, the same underlying function is continuous as a map $f': X \to cY$ since $f't$ is continuous for every test map $t$ to $X$. It follows that $c$ extends to a functor $\mathbf{Top} \to c\mathbf{Top}$ right adjoint to the inclusion $c\mathbf{Top} \to \mathbf{Top}$, and $c$ is a functor over the forgetful functor $U:\mathbf{Top}\to\mathbf{Set}$. Then by composition with the inclusion functor we have a functor on $\mathbf{Top}$ over $U$.
For example, one could choose $\mathcal C$ to be the class of all compact spaces, then a $c$-space is a compactly generated space. If $\mathcal C$ is the class of all compact Hausdorff spaces, a $c$-space is what we call a $k$-space, and these form a Cartesian closed category (when we change the product topology on $X\times Y$).
This also works in the dual way, by equipping $X$ with the initial topology with respect to all continuous maps from $X$ to the spaces in the class $\mathcal C$. In that case, we get a functor which is left adjoint to the inclusion functor. A notable choice is $\mathcal C = \{\Bbb R\}$, in which case we obtain the category of all completely regular spaces.
