Does the forgetful functor from $\mathbf{TopGrp}$ to $\mathbf{Top}$ admit a left adjoint?

Let $\mathcal{F}$ be a set of continuous maps from $X$ such that $cod(f)$ is a topological group for each $f ∈ \mathcal{F}$ and every continuous map from $X$ to a topological group factors thought some map from $\mathcal{F}$. Such set exists since it is enough to consider maps whose images generate the codomain group, so their cardinalities are bounded. Consider $i: X \to ∏_{f ∈ \mathcal{F}} cod(f)$ defined as $i(x)(f) = f(x)$.

Clearly, $∏_{f ∈ \mathcal{F}} cod(f)$ is a topological group and $π_f \circ i$ is continuous for each $f ∈ \mathcal{F}$, so $i$ is continuous.

Every continuous $g: X \to G$ factors through some $f ∈ \mathcal{F}$, and for $g'$ defined as $g'(α) = π_f(α) = α(f): X \to cod(f) ⊆ G$ we have $g'(i(x)) = i(x)(f) = f(x) = g(x)$. Clearly, $g'$ is continuous homorphism.

It is enough to consider the subgroup of $∏_{f ∈ \mathcal{F}} cod(f)$ generated by $i[X]$, on which we have also the uniqueness of the extension.

We may also observe, that $i$ is always injective and it is a topological embedding if $X$ is completely regular.


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.