Request for gentle explanation of defining a topology with its universal property

I am reading a book which says that whenever we can define a topology by saying "its the largest topology which satisfy $p$" then it is possible to define the same topology by saying it is the "smallest topology which satisfy $q$". Why is that? Here is an example:

Consider $f:X\rightarrow Y$ and a given topology on $X$, then there is a largest (or finest) topology on $Y$ which makes $f$ continuous. But, the very same topology on $Y$ can be defined as the smallest (or coarsest) topology on $Y$ which satisfy the property: for every other topological space $Z$ and $g:Y\rightarrow Z$, the continuity of $g\circ f$ implies the continuity of $g$.

I need more elaboration on this or a scratch of a proof. (Even though, I assume it is obvious for most people). Many thanks.


Let $(X_i)_i$ be a collection of topological spaces, and let $(f_i:X_i\rightarrow Y)_i$ be a collection of functions to the set $Y$. The finest topology on $Y$ which makes all $f_i$ continuous is called the final topology $\tau_f$. Consider any topology $\tau_*$ on $Y$ with the property

When $g:Y\to Z$ is a function to any space $Z$, then $g$ is continuous if $gf_i:X_i\to Z$ is continuous for each $i\in I$.

Consider the identity function $\text{id}:(Y,\tau_*)\rightarrow Z:=(Y,\tau_f)$ and think of those $f_i$ as maps from $X_i$ into $(Y,\tau_*)$. Then the compositions $\text{id}\circ f_i$ are the maps $f_i:X_i\rightarrow(Y,\tau_f)$. These maps are continuous by definition of the final topology. The universal property then implies that $\text{id}$ is continuous, hence $\tau_*$ is finer than $\tau_f$.

So $\tau_f$ is the coarsest topology satisfying the property written in Italics in your question. The finest topology would be the discrete one.

Usually one modifies the formulation of this property a bit so that it defines the topology on $Y$ uniquely by demanding a topology such that $g$ is continuous if and only if $g\circ f_i$ is continuous for all $i$.