TITLE: Does the forgetful functor from $\mathbf{TopGrp}$ to $\mathbf{Top}$ admit a left adjoint?
QUESTION [16 upvotes]: Let TopGrp be the category of topological groups (not necessarily $T_0$) and Top the category of topological spaces. Does the forgetful functor  $U:\mathbf{TopGrp}\to\mathbf{Top}$ admit a left adjoint?
To be concrete, given an arbitrary topological space $X$, my question is that, can we find a topological group $\Gamma X$ and a continuous map $\iota:X\to\Gamma X$ such that, for any topological group $G$ and any continuous map $f:X\to G$, there exists a unique continuous group homomorphism $f^\prime:\Gamma X\to G$ satisfying $f=f^\prime\circ\iota$?

REPLY [3 votes]: If $\mathcal{C}$ is a cocomplete cartesian closed category, then the forgetful functor $\mathsf{Grp}(\mathcal{C}) \to \mathcal{C}$ has a left adjoint. More generally, if $\tau$ is any type of algebraic structures, the forgetful functor $\mathsf{Alg}_{\tau}(\mathcal{C}) \to \mathcal{C}$ has a left adjoint. This is also what goblin mentioned in the comments. (This result should be well-known, but right now I have no reference for it.)
Unfortunately, $\mathsf{Top}$ is not cartesian closed. But the category of compactly generated weak Hausdorff spaces $\mathsf{CGWH}$ is cartesian closed and is (in contrast to $\mathsf{Top}$) a convenient category of topological spaces. It follows that $\mathsf{Grp}(\mathsf{CGWH}) \to \mathsf{CGWH}$ has a left adjoint. Also, $\mathsf{Grp}(\mathsf{CGWH})$ is complete and cocomplete.