TITLE: Does the path component functor admit a right adjoint?
QUESTION [6 upvotes]: Does $\pi_0:Top\to Set$, sending a topological space to its path-connected components, admit a right adjoint?
If not, does it admit a right adjoint if we restrict it to certain topological spaces, say CW complexes?

REPLY [6 votes]: As someone mentioned, this can't be done in general, but if we restrict ourselves to locally path connected spaces (in which path components and connected components coincide) $\pi_0$ has a right adjoint.
Let $Top$ denote the category of locally path connected spaces,
define $F: Set \rightarrow Top$ by taking a set $A$ to $A$ with the discrete topology. Since continuous maps preserve connected components, the value of a function
$$f: X \rightarrow A$$
in a connected component is determined by a single point in the component. Thus
$$\mathrm{Hom}_{Top}(X,F(A)) \cong \mathrm{Hom}_{Set}(\pi_0(X),A).$$