Maps between classifying spaces Let $G$ be a discrete group and let $BG \simeq K(G,1)$ be its classifying space. Let $H$ be a topological group with classifying space $BH$. 


*

*In case $H$ is also discrete, it was pointed out in the (comments to one) answer of this question that $hom(G,H)$ is in bijection with $[BG,BH]_0$. 




Is there anything along the lines of the above statements that can be said in case $H$ is a nonabelian topological group? 


Let $A \to C$ be a (topological) crossed module. This also has a classifying space $B(A \to C)$ - the classifying space of the associated $2$-group. 


What is the relationship between the first group cohomology of $G$ with coefficients in $A \to C$, i.e. $H^1(G, A \to C)$ and $[BG, B(A \to C)]_0$.


 A: Let $\mathbf{H}$ be an $\infty$-topos (in your case, you want to take the $\infty$-topos of spaces, $\mathcal{S}$). There is an equivalence of $\infty$-categories
$$
\Omega : \operatorname{Grp}(\mathbf{H}) \to \mathbf{H}^{\ast/}_{\geq 1}, \quad \mathbf{B} : \mathbf{H}^{\ast/}_{\geq 1} \to \operatorname{Grp}(\mathbf{H})
$$
between the $\infty$-categories of $\infty$-group objects in $\mathbf{H}$ (with $\infty$-group homomorphisms between them) and that of pointed, connected objects in $\mathbf{H}$ (where maps should respect the basepoints), mediated by the usual looping and delooping functors —here $\Omega$ is left adjoint to $\mathbf{B}$. This is all in Lurie's Higher Topos Theory, but I recommend the exposition in Nikolaus, Schreiber and Stevenson's Principal $\infty$-bundles - General Theory.
Discrete groups are $0$-truncated objects in $\operatorname{Grp}(\mathcal{S})$, and the equivalence above implies an equivalence of mapping spaces:
$$
B : \operatorname{Map}_{\operatorname{Grp}(\mathcal{S})}(G, H) \to \operatorname{Map}_{\mathcal{S}^{\ast/}_{\geq 1}}(\mathbf{B}G, \mathbf{B}H)
$$
The left hand side here is homotopy equivalent to the set of group homomorphisms from $G$ to $H$, and taking $\pi_0$ gets you the desired bijection: $\hom(G, H) \cong [\mathbf{B}G, \mathbf{B}H]_0$.
If $H$ is not discrete, $\mathbf{B}H$ is no longer an Eilenberg-Maclane space: rather, $\pi_{i+1}(\mathbf{B}H, \ast) = \pi_i (H, e)$.


*

*If what you really want is $K(H,1)$, you can give $H$ the discrete topology —call it $H^\delta$. Then you have $\mathbf{B}H^\delta \simeq K(H,1)$, and a bijection $$\hom(G, H) \cong \pi_0\operatorname{Map}_{\operatorname{Grp}(\mathcal{S})}(G, H^\delta) \cong [K(G, 1), K(H, 1)]_0$$ Forgetting the topology on $H$ is no big deal because $G$ is discrete.

*For the classifying space $\mathbf{B}H$ things are more complicated. The most you (or at least I) can say is that there is a bijection $$\pi_0\operatorname{Map}_{\operatorname{Grp}(\mathcal{S})}(G, H) \cong [\mathbf{B}G, \mathbf{B}H]_0$$

As for your second question, the first group cohomology group with values in the 2-group associated to the crossed module $A \to C$ is given by the set of homotopy classes of (unbased) maps from $\mathbf{B}G$ to $\mathbf{B}(A \to C)$:
$$
H^1(G, A \to C) = [ \mathbf{B}G, \mathbf{B}(A \to C) ]
$$
(see the nLab pages on cohomology and group cohomology).
A: It may help to look at some of the papers of Ronnie Brown for the last part, and I would also mention two papers by Ronnie Brown, Marek, Golasinski, myself, and Andy Tonks,Spaces of maps into classifying spaces for equivariant crossed complexes, that interprets a similar problem in the case of $G$-equivariant maps where $G$ is either discrete or in the second paper is a general topological group.
