While reading Hatcher's algebraic topology book, the construction $J(X)$ is refered to as the "freest" H-space structure on a topological space $X$. I wanted to solidify this intuiton by showing that $J(-)$ can be seen as the left adjoint functor to the forgetful functor from the category of H-spaces to the category of topological spaces.
I believe the bijection $Top(X, H)\cong H-space(J(X), H)$ can be taken to send a map in $H-space(J(X), H)$ to its restriction. The other way is somewhat trickier, but I think I can just extend multiplicatively using the fact that $J(X)$ is generated by $X$.
I am having trouble showing however that the map constructed this way is continuous/well defined because I am not very comfortable with the fact that everything in the category of H-spaces is up to homotopy.
Does anybody know whether I am missing something, or if this is correct?