Universal Property to Representable Functor - Example of Quotient Topology $\newcommand{\Top}{\mathsf{Top}}\newcommand{\Set}{\mathsf{Set}}$I am an undergraduate reading about category theory and topology, using the former to understand the latter. My question is about translating knowledge about universal properties to knowledge about representable functors, the representing object and the universal element giving the natural isomorphism. Specifically, how does one go about it, given the universal property?
As a concrete example, suppose you are given a universal property that some object satisfies, for example the universal property for the quotient topology on a space $S$, given a surjective map to $S$:

After reading Wikipedia, I understood that this is equivalent to asserting the natural isomorphism for a representable functor $\Top^{\pi}(X,\_)$ as follows (hidden if you want to give it a try!):

 $\Top^{\pi}(X,\_) \cong \Top(S,\_)$ given (via Yoneda Lemma) by $\pi\in\Top^{\pi}(X,S)$ - here, $\Top^{\pi}(X,\_):\Top\to\Set$ is a covariant functor that takes a topological space $(Z,T_z)$ to $\{ f \in\Top(X,Z) | \pi(x) = \pi(y) \implies f(x) = f(y) \forall x,y \in X \}$ i.e. to continuous functors $X\to Z$ constant over the fibres of $\pi$.

However, prior to reading Wikipedia, as I tried to translate the universal property to derive a representable functor, I was unable to do so. Specifically, I knew that I wanted to establish a natural isomorphism as above, but I couldn't define $\Top^{\pi}(X,\_)$ myself, perhaps because I lack the maturity right now.
Therefore, I wanted to ask you all: how do you translate knowledge of a universal property given as a sentence, to knowledge of a representable functor, its representing object and the universal element?
 A: In my opinion the right way to think of a (co)universal property is not in terms of the corresponding universal element (in your example the quotient map). Instead the universal element is something you get out of the more conceptual description via representable functors. I will explain what I mean through examples.
A universal property of an object $X$ in a category is in its most general sense a description of the arrows into $X$. Dually a couniversal property is a description of the arrows which point out of $X$. In the next section I will try to argue that a description of the arrows into an object $X$ is naturally a functor $F$ together with a natural isomorphism $F\cong \mathbb C(-,X)$. If you already belive that, then you can skip the part.
What can be a description of the arrows into $X$? Well, for each object $S$ you need an (interesting or less interesting) way to describe the homset $\mathbb C(S,X)$. A way to describe a set is to put it into bijection with a different set $FS\cong \mathbb C(S,X)$. Now if $\ulcorner
 f\urcorner \in FS$ is the description of an arrow $f: S \to X$ and $g:T\to S$ is an actual arrow in $\mathbb C$, then there should be something in $FT$ which describes $fg: T\to X$. Let us denote that thing by $\ulcorner fg\urcorner = (Fg)\ulcorner f\urcorner$. So we see that a description $F$ of the arrows into $X$ not only consists of a set $FS$ of names for the arrows $S \to X$ for each $S$, but such a description also naturally comes with a function $Fg: FS \to FT$ for each $T \to S$ in the category $\mathbb C$. Or in other words: If you have any collection of sets $FS$ indexed by the objects $S$ of $\mathbb C$ and any bijections $\alpha_S: FS \cong \mathbb C(S,X)$, then there is a unique way to extend the assignment $S \mapsto FS$ to a contravariant functor $\mathbb C^{\text{op}} \to \mathbf{Set}$ such that $\alpha$ becomes a natural transformation.
Thus we make the following definition: A description of the system of arrows into $X$ is a contravariant functor $F$ together with a natural isomorphism $F\cong \mathbb C(-,X)$. Once we have that definition we can also go the other way around. We can start with a description $F$ and ask if the functor is representable, i.e. if there is an object $X$ and a natural isomorphism $F \cong \mathbb C(-,X)$. By the Yoneda lemma the description $F$ determines the object $X$ it describes up to unique isomorphisms compatible with the natural transformations. The following examples will show that our definition of universal property (description of arrows into an object) is general enough.

*

*Let's start with your example (actually a couniversal property). Say you have a space $X$ and an equivalence relation $R$ on the underlying set of points of $X$. For each test space $T$ it is now natural to consider the continuous maps $X \to T$ whose underlying set maps respect the equivalence relation $R$. Thus we may form a description $FT = \{f\in \mathbf{Top}(X,T)\,|\, \text{if } xRy \text{ then } fx = fy\,\}$. It is not hard to see that this defines the quotient space $X/R$, namely $FT \cong \mathbb C(T,X/R)$ naturally in $T$.


*What is the representable functor for an embedding $i: S\to X$ of topological spaces. Well, let us look how we can describe the morphisms which point into $S$. The topology on $S$ is such that a morphism into $S$ is exactly the same thing as a morphism into $X$ with set theoretic image contained in $S$. We have the following description. $\mathbf{Top}(T,S) \cong \{f\in \mathbf{Top}(T,X)\,|\, f(T)\subset i(S)\}$. We did supress the forgetful functor into the category of sets in the notation.


*There a lot of examples from algebra. For example consider the free vector space $k^n$ of $n$ generators over a field $k$. A linear map $k^n\to V$ is completely determined by its action on the $n$ basis elements of $k^n$, so we see that $\mathbf{Vect}_k(k^n,V) \cong \{\text{$n$ elements of $V$}\} \cong (UV)^n$ and that is the universal property of $k^n$. Here $U$ is again the forgetful functor.


*Let $A$ and $B$ are two modules over a commutative ring $R$. What is the universal property of $A\otimes_RB$? A $R$-linear map $A\otimes_RB \to M$ should be the same thing as a $R$-bilinear map $A\times B \to M$. Hence we see that $\mathbf{Mod}_R(A\otimes_RB,M) \cong \operatorname{Bilin}(A,B;M)$. Both sides are covariant functors in $M$. This is the universal property of the tensor product.


*Every object $X$ has a tautological universal property. "The arrows into $X$ are the arrows into $X$". By Yoneda $X$ is up to isomorphism determined by the tautological description $\mathbb C(-,X)$ of arrows into it.


*You can now find the (co)universal properties of: $\mathbb  Z[x,y]$ in the category of rings, $X\times Y$ in the category of spaces, $X \sqcup Y$ in the category of spaces, the free group on $n$ generators in the category of groups, etc. The list of examples is endless.
The last step is to understand how the quotient map/the projection maps of the product/etc. fit into the picture. This also tells how to get back from the representable functor version of the universal property to the elementary description in terms of "there exists a unique arrow such that ...". By Yoneda a natural transformation $\alpha: \mathbb C(-,X) \Rightarrow F$ determines and is completely determined by $\alpha_X(1_X) \in FX$. This is the universal element of the universal property. Saying that $\alpha$ is a bijection is now the same as saying: For each object $S$ and arrow $y \in FS$ there is ($\alpha_S$ is surjective) a unique ($\alpha_S$ is injective) $f\in \mathbb C(S,X)$ such that $y = \alpha_S f = (Ff)(\alpha_X1_X)$. Let us try this with an example.
By definition $A\otimes_RB$ is the representing object of $\operatorname{Bilin}(A,B;-)$. So there is a natural ismorphism $\alpha: \mathbf{Mod}_R(A\otimes_RB,-) \Rightarrow \operatorname{Bilin}(A,B;-)$. By Yoneda the data of such a transformation is the same as the data of a special element $\alpha_{A\otimes_RB}(\operatorname{id}) \in \operatorname{Bilin}(A,B;A \otimes_R B)$. Let us denote that special element by $\otimes: A\times B \to A \otimes_R B$. Now it is not hard to see that the requirement that $\alpha$ is a natural isomorphism translates directly to the usual universal property of $\otimes$ in elementary terms.
You can now try the following: Start with the functor $T \mapsto \{f\in \mathbf{Top}(X,T)\,|\, \text{if } xRy \text{ then } fx = fy\,\}$ and define the object $X/R$ to be a representation of that functor. Show that this automatically means that $X/R$ comes equipped with a special map $X \to X/R$ and that that special map satisfies the usual universal property of a quotient map.
Have fun. A good reference is Emily Riehl's book Categories in Context. It contains many more examples.
