[proofplan]
We construct limits and colimits for an arbitrary small diagram $D:J\to\mathsf{Top}$. The limit is the subspace of the product of all object spaces consisting of compatible tuples. The colimit is the quotient of the disjoint union of all object spaces by the [equivalence relation](/page/Equivalence%20Relation) generated by the diagram maps. The defining universal properties of the [product topology](/page/Product%20Topology), [subspace topology](/page/Subspace%20Topology), coproduct topology, and [quotient topology](/page/Quotient%20Topology) prove that these constructions represent cones and cocones.
[/proofplan]
[step:Construct the limit as the compatible subspace of the product]
Let $J$ be a small category, and let $D:J\to\mathsf{Top}$ be a diagram. For each object $j\in \operatorname{Ob}(J)$, write $D_j$ for the topological space $D(j)$. For each morphism $a:j\to k$ in $J$, write
\begin{align*}
D_a:D_j\to D_k
\end{align*}
for the continuous map $D(a)$.
Let $P$ be the product topological space
\begin{align*}
P:=\prod_{j\in \operatorname{Ob}(J)} D_j,
\end{align*}
with projection maps
\begin{align*}
\pi_j:P\to D_j.
\end{align*}
Define the subset $L\subset P$ by
\begin{align*}
L:=\{x\in P: D_a(\pi_j(x))=\pi_k(x)\text{ for every morphism }a:j\to k\text{ in }J\}.
\end{align*}
Equip $L$ with the subspace topology, and define
\begin{align*}
\lambda_j:L&\to D_j\\
x&\mapsto \pi_j(x).
\end{align*}
Each $\lambda_j$ is continuous because it is the restriction of the continuous projection $\pi_j$. By the definition of $L$, for every morphism $a:j\to k$ in $J$,
\begin{align*}
D_a\circ \lambda_j=\lambda_k.
\end{align*}
Thus $(L,(\lambda_j)_{j\in\operatorname{Ob}(J)})$ is a cone over $D$.
[/step]
[step:Verify the universal property of the constructed limit]
Let $Y$ be a topological space, and let
\begin{align*}
f_j:Y\to D_j
\end{align*}
be a cone over $D$, meaning each $f_j$ is continuous and, for every morphism $a:j\to k$ in $J$,
\begin{align*}
D_a\circ f_j=f_k.
\end{align*}
By the [universal property of the product topology](/theorems/962), there is a unique continuous map
\begin{align*}
f:Y&\to P\\
y&\mapsto (f_j(y))_{j\in\operatorname{Ob}(J)}
\end{align*}
such that $\pi_j\circ f=f_j$ for every $j$.
The cone identities imply that $f(y)\in L$ for every $y\in Y$. Hence $f$ factors uniquely through the inclusion $L\subset P$, giving a map
\begin{align*}
\bar f:Y&\to L\\
y&\mapsto (f_j(y))_{j\in\operatorname{Ob}(J)}.
\end{align*}
The map $\bar f$ is continuous by the subspace topology because the composite $Y\xrightarrow{\bar f}L\subset P$ is the continuous map $f$. Moreover,
\begin{align*}
\lambda_j\circ \bar f=f_j
\end{align*}
for every $j$. If $g:Y\to L$ is another continuous map with $\lambda_j\circ g=f_j$ for every $j$, then the composites into every factor of $P$ agree, so $g=\bar f$ by equality of product coordinates. Therefore $L$ is the limit of $D$.
[/step]
[step:Construct the colimit as a quotient of the disjoint union]
Let $S$ be the coproduct topological space
\begin{align*}
S:=\coprod_{j\in\operatorname{Ob}(J)}D_j,
\end{align*}
with canonical continuous inclusions
\begin{align*}
\iota_j:D_j\to S.
\end{align*}
Let $\sim$ be the smallest equivalence relation on the underlying set of $S$ such that, for every morphism $a:j\to k$ in $J$ and every $x\in D_j$,
\begin{align*}
\iota_j(x)\sim \iota_k(D_a(x)).
\end{align*}
Let $C:=S/{\sim}$ be the quotient topological space, and let
\begin{align*}
q:S\to C
\end{align*}
be the quotient map. Define
\begin{align*}
\gamma_j:D_j&\to C\\
x&\mapsto q(\iota_j(x)).
\end{align*}
Each $\gamma_j=q\circ\iota_j$ is continuous. The defining relation gives, for every morphism $a:j\to k$ in $J$,
\begin{align*}
\gamma_j=\gamma_k\circ D_a.
\end{align*}
Thus $(C,(\gamma_j)_{j\in\operatorname{Ob}(J)})$ is a cocone under $D$.
[/step]
[step:Verify the universal property of the constructed colimit]
Let $Y$ be a topological space, and let
\begin{align*}
g_j:D_j\to Y
\end{align*}
be a cocone under $D$, meaning each $g_j$ is continuous and, for every morphism $a:j\to k$ in $J$,
\begin{align*}
g_j=g_k\circ D_a.
\end{align*}
By the universal property of the coproduct topology, there is a unique continuous map
\begin{align*}
G:S\to Y
\end{align*}
such that
\begin{align*}
G\circ\iota_j=g_j
\end{align*}
for every $j$.
The cocone identities imply that $G$ is constant on $\sim$-equivalence classes: the relation $\sim$ is generated by pairs $\iota_j(x)\sim\iota_k(D_a(x))$, and on each generating pair,
\begin{align*}
G(\iota_j(x))=g_j(x)=g_k(D_a(x))=G(\iota_k(D_a(x))).
\end{align*}
Therefore there is a unique set map
\begin{align*}
\bar G:C\to Y
\end{align*}
such that $\bar G\circ q=G$. By the definition of the quotient topology, $\bar G$ is continuous because $G=\bar G\circ q$ is continuous. Also,
\begin{align*}
\bar G\circ\gamma_j=g_j
\end{align*}
for every $j$. If $H:C\to Y$ is another continuous map with $H\circ\gamma_j=g_j$ for every $j$, then $H\circ q$ and $\bar G\circ q$ agree on every coproduct summand $\iota_j(D_j)$, hence agree on all of $S$. Since $q$ is surjective, $H=\bar G$. Therefore $C$ is the colimit of $D$.
[/step]
[step:Conclude that $\mathsf{Top}$ has all small limits and colimits]
The preceding construction gives a limit for every small diagram $D:J\to\mathsf{Top}$ and a colimit for every small diagram $D:J\to\mathsf{Top}$. Hence $\mathsf{Top}$ has all small limits and all small colimits. Therefore $\mathsf{Top}$ is complete and cocomplete.
[/step]