What categorical limits and colimits does $\pi_1$ preserve?

The doom and gloom here comes from using the wrong notion. Note that limits and colimits of topological spaces are not homotopically invariant (that is, they aren't well-defined operations on homotopy classes of diagrams of spaces), so for the purposes of homotopy theory they aren't always the right thing to do. You should instead be looking at homotopy limits and homotopy colimits, which are in a suitable sense the "derived functors" of limits and colimits; in particular, they are homotopically invariant constructions.

Here the news is much better. The nicest statement comes when we avoid basepoints and instead replace the fundamental group with the fundamental groupoid $\Pi_1(X)$, which is a (higher) functor from spaces to the $2$-category of groupoids, functors, and natural transformations. This is important because $2$-categories also have a notion of homotopy limits and colimits, also called $2$-limits and $2$-colimits. And now I claim that

$\Pi_1$ preserves all homotopy colimits.

This is an abstract and high-powered version of the Seifert-van Kampen theorem (although admittedly it's only useful to the extent that you can actually compute homotopy colimits). Unlike the usual Seifert-van Kampen theorem, it is powerful enough to allow you to compute the fundamental group of $S^1$ by decomposing it as two intervals which intersect in two points; the point is that working with fundamental groupoids gives you the freedom to use more than one basepoint. This argument should be somewhere in Brown's Topology and Groupoids.

Morally this result is true because $\Pi_1$ is the homotopy left adjoint to the "forgetful functor" sending a groupoid $\Pi$ to its classifying space $B\Pi$ (a mild generalization of the construction of Eilenberg-MacLane spaces). The ordinary Seifert-van Kampen theorem can be thought of as giving conditions under which it is possible to compute a homotopy pushout in spaces as an ordinary pushout.

Example. Let $G$ be a group acting on a path-connected space $X$ preserving a basepoint $x$. The ordinary quotient $X/G$, or $X_G$, is a prime example of a colimit which is not a homotopically invariant operation: in general the homotopy type of the quotient is very sensitive to exactly how $G$ acts on $X$, and we cannot replace the action by a homotopy equivalent action. In particular the fundamental group of $X/G$ is not determined from the data of the action of $G$ on $\pi_1(X, x)$.

The homotopically invariant replacement is the homotopy quotient or Borel construction, variously notated $X//G$ or $X_{hG}$, and given explicitly by

$$X \times_G EG$$

where $EG$ is a contractible space on which $G$ acts freely and $\times_G$ means to take the quotient of the product by the diagonal action of $G$. The idea is that $X \times EG$ is a "resolution" of $X$ as a $G$-space suitable for computing the "derived functor" of taking quotients.

The abstract Seifert-van Kampen theorem above now implies that the fundamental group of $X//G$ is the homotopy quotient of $\pi_1(X, x)$ by the action of $G$. Once you work out what homotopy quotients are for groupoids, this turns out to be precisely the semidirect product

$$\pi_1(X, x) \rtimes G.$$

Something more complicated happens if you don't assume that $G$ preserves a basepoint or if you use the more general and homotopically correct definition of "action of $G$," but that's another story.


$\pi_1$ preserves arbitrary products (not just finite ones); this is easy to check.

$\pi_1$ does not preserve coproducts in general. See math:SE/320812. Seifert van Kampen's Theorem only applies under certain assumptions.

$\pi_1$ does typically not preserve pushouts. For example $S^1$ is the pushout of two open intervals which have trivial $\pi_1$, but $\pi_1(S^1)$ is not trivial. (A possible replacement for this failure is the long exact sequence of homotopy groups associated to a fibration. Also, we have Seifert van Kampen's Theorem which states that certain "nice" pushouts are preserved.)

$\pi_1$ does typically not preserve pullbacks. For example, $S^1$ is the intersection of two hemispheres $\cong D^2$ in $S^2$, which have trivial $\pi_1$, but $\pi_1(S^1)$ is not trivial.

$\pi_1$ does not preserve monomorphisms (consider $S^1 \to D^2$) and it does not preserve epimorphisms (consider $\mathbb{R} \to S^1$).