Yes. The principal bundles are the same and your guess that $BA$ is an abelian group is exactly right. A good reference for this story, and of Segal's result that David Roberts quotes, is Segal's paper:
G. Segal. Cohomology of topological groups, Symposia Mathematica IV (1970), 377- 387.
The functors $E$ and $B$ can be described in two steps. First you form a simplicial topological space, and then you realize this space. It is easy to see directly that $EG$ is always a group and that there is an inclusion $G \rightarrow EG$, which induces the action. The quotient is $BG$. Under suitable conditions, for example if $G$ is locally contractible (which includes the discrete case), the map $EG\rightarrow BG$ will admit local sections and so $EG$ will be a $G$-principal bundle over $BG$. This is proven in the appendix of Segal's paper, above. There are other conditions (well pointedness) which will do a similar thing.
The inclusion of $G$ into $EG$ is a normal subgroup precisely when $G$ is abelian, and so in this case $BG$ is again an abelian group.
I believe your question was implicitly in the discrete setting, but the non-discrete setting is relevant and is the subject of Segal's paper. Roughly here is the answer: Given an abelian (topological) group $H$, the $BH$-princical bundles over a space $X$ are classified by the homotopy classes of maps $[X, BBH]$. When $H$ is discrete, $BBH = K(H,2)$. If $X = K(G,1)$ for a discrete group $G$, these correspond to (central) group extensions:
$$H \rightarrow E \rightarrow G$$
If $G$ has topology, then the group extensions can be more interesting. For example there can be non-trivial group extensions which are trivial as principal bundles. Easy example exist when H is a contractible group. However Segal developed a cohomology theory which classifies all these extensions. That is the subject of his paper.
Added Aug 2016: I've written this up, available at https://arxiv.org/abs/1608.02999
$\def\Hom{\mathrm{Hom}} \def\Map{\mathrm{Map}} \def\ad{\mathrm{ad}}$
I think this is true. I'll sketch a possible proof here. I haven't
carefully checked everything, and there are things that need checking. Feel free to do that.
First, we can assume $H=G$: we want to show that $(B_G\Pi)^G\to
\mathrm{Map}(BG,B\Pi)$ is an equivalence if $G$ is
compact Lie and $\Pi$ is compact Lie and a 1-type.
We might as well
consider the induced map on homotopy fibers over the maps to $B\Pi$ (induced by
evaluating at the basepoint of $BG$.) That is, we want to show
$$
\Hom(G,\Pi) \to \Map_*(BG,B\Pi)
$$
is a weak equivalence. Here $\Hom(G,\Pi)$ is topologized as a
subspace of $\Map(G,\Pi)$. We know that this is homeomorphic to
$\coprod_{[\phi]} \Pi/C_\Pi(\phi(G))$, a coproduct over conjugacy
classes of homomorphisms $G\to \Pi$ (see
Nearby homomorphisms from compact Lie groups are conjugate).
Given this, it is already clear we get an equivalence when $G$ is
compact and connected (reduce to the case where $\Pi$
is a torus). It's not so easy to see why this is so for general $G$:
although we can "compute" both sides, the accounting is different and
hard to match up.
Here's an attempt at a general proof, based on the ideas which work
when $\Pi$ is a torus (which involve the idea of continuous cochains
as in Graeme Segal, "Cohomology of topological groups"). It should fit into some already-known technology (cohomology of topological groups with coefficients in a topological 2-group?), but I don't want to bother to figure out what or how.
Consider data consisting of
(It's a kind of crossed module.) Given this, define $E(G, (\Pi,V))$
to be the space of pairs $(f,v)$ where $f\colon G\to \Pi$ and $v\colon
G\times G\to V$ are continuous maps, satisfying
- $f(g_1)f(g_2)=\exp[ v(g_1,g_2)] f(g_1g_2)$,
- $v(g_1,g_2)+v(g_1g_2,g_3)= \ad(f(g_1))v(g_2,g_3) + v(g_1,g_2g_3)$.
(I might want to additionally require a normalization: $f(e)=e$. Or not.)
The examples I have in mind are $E:= E(G, (\Pi, T_e\Pi))$ and $E^0:=
E(G, (\Pi,0))$. The claims are as follows.
$E$ is weakly equivalent to $\Map_*(BG,B\Pi)$. To compute the
mapping space, you need to climb the cosimplicial space $[k] \mapsto
\Map_*(G^k, B\Pi)$. Because $B\Pi$ is a 2-type, you don't need to
climb very far. The idea is that if you do this, and you keep in mind
facts such as:
$\Pi$ is equivalent to $\Omega B\Pi$, and
the fibration $(v,\pi)\mapsto (\pi, \exp[v]\pi) \colon V\times\Pi\to \Pi\times \Pi$ is equivalent to the free path fibration $\Map([0,1],\Pi)\to \Pi\times \Pi$,
you see that you get an equivalence. (I came up with the definition
of $E$ exactly by doing this.)
That's kind of sketchy.
More concretely: $\Map_*(BG,B\Pi)$ can be identified with the space of maps between pointed simplicial spaces, from $G^\bullet$ to $S_\bullet:=\bigl([n]\mapsto \Map_*(\Delta^n/\mathrm{Sk}_0\Delta^n, B\Pi)\bigr)$. The space $E$ is also a space of maps between such, from $G^\bullet$ to $N_\bullet$, where $N_\bullet$ is a simplicial space built from the crossed module $(\Pi,V)$ (the nerve of the crossed module, as in https://mathoverflow.net/q/86486 ) with $N_n \approx \Pi^n\times V^{\binom{n}{2}}$. It's not to hard to show that $N_\bullet$ and $S_\bullet$ are weakly equivalent Reedy fibrant simplicial spaces; they both receive a map from $\Pi^\bullet$, which exhibits the equivalence. (But note: showing that $N_\bullet$ is Reedy fibrant relies crucially on the fact that $\exp$ is a covering map.)
$E^0$ is homeomorphic to $\Hom(G,\Pi)$. Yup.
The inclusion $E^0\subseteq E$ is a weak equivalence.
To see this, let $C^1:=\Map(G,V)$, as a topological group under
pointwise addition. There is an action $C^1\curvearrowright E$, by
$u\cdot (f,v)=(f',v')$ where
- $f'(g) := \exp[u(g)] f(g)$,
- $v'(g_1,g_2) := u(g_1)-u(g_1g_2) + \ad(f(g_1))u(g_2) + v(g_1,g_2)$.
It's useful to note that for any $(f,v)\in E$, the resulting map
$G\xrightarrow{f} \Pi\to \Pi/\Pi_0$ is a homomorphism. Thus we write
$E=\coprod E_\gamma$ for $\gamma\in \Hom(G,\Pi/\Pi_0)$, and $C^1$ acts
on each $E_\gamma$.
Consider $(f,0)\in E_\gamma^0= E_\gamma\cap E^0$. Note that $u\cdot (f,0)$ has the form $(f',0)$ for some $f'$ if and
only if $u\in Z^1_\gamma$, where this is the set of $u\colon G\to V$
such that
- $u(g_1)-u(g_1g_2) + \ad\gamma(g_1) u(g_2)=0$.
So the action passes to an injective map $C^1\times_{Z^1_\gamma} E^0_\gamma\to
E_\gamma$. In fact, it should be a homeomorphism. To see that it's
surjective, fix
$(f,v)\in E_\gamma$; we need to solve for $u\in C^1$ such that
- $u(g_1)-u(g_1g_2)+\ad\gamma(g_1)u(g_2)=v(g_1,g_2)$.
This amounts to the vanishing of $H^2$ in the complex $C^\bullet_\gamma$ of
continuous
cochains: $C^t_\gamma:=\Map(G^{t}, V_\gamma)$ (where the differential uses
the action $\ad\gamma\colon G\to\mathrm{Aut}(V)$). The
vanishing is because $G$ is compact, so we can "average" over Haar
measure to turn a non-equivariant contracting homotopy on
$D^\bullet_\gamma=\Map(G^{\bullet+1}, V_\gamma)$ into a contracting homotopy
on $C^\bullet_\gamma = (D^\bullet_\gamma)^G$.
Given this, since both $C^1$ and $Z^1_\gamma$ are
contractible groups, (in fact, $Z^1_\gamma=V/V^{\gamma(G)}$ by $H^1=0$), we
should have that $C^1\times_{Z^1_\gamma} E^0_\gamma$ is weakly
equivalent to $E^0_\gamma$.
Note: in the case that $\Pi$ is abelian, we simply get a homeomorphism
$C^1\times E^0\approx E$.
Best Answer
Proof of (1):
(a). Suppose $X$ and $Y$ are $G$-spaces, the action of $G$ on $X$ is free, and $X\to X/G$ is a principal bundle, then the space of $G$-equivariant maps $$ F(X,Y)^G $$ is the same thing as the space of sections of the fibration $X\times_G Y \to X/G$.
(b). If $E\to B$ is a Hurewicz fibration, with $B$ connected and the fiber contractible, then the space of sections is again contractible. This can be seen as follows: the adjunction property shows that $$ \text{sec}(E \to B) \to F(B,E) \to F(B,B) $$ is a fibration (the displayed fiber is the space of sections---it's the fiber over the basepoint of $F(B,B)$ given by the identity map of $B$---and the other two spaces are function spaces). Since $F$ is contractible the map $E\to B$ is a homotopy equivalence and therefore so is $F(B,E) \to F(B,B)$. Hence $\text{sec}(E\to B)$ is contractible.
(c). It follows from (a) and (b) that the space of sections of $X\times_G Y \to X/G$ is contractible whenever $Y$ is.
(d). In your case, $X = P$ and $Y = EG$. Hence, $F(P,EG)^G$ is contractible.
Proof of (2):
I'll prove something slightly less, which is enough for what you wish to have:
I claim that if $X \to X/G$ and $Y \to Y/G$ are principal $G$-bundles then the map $$ F(X,Y)^G \to F(X/G,Y/G) $$ is a Hurewicz fibration. This is the same thing as the map $$ \text{sec}(X\times_G Y\to X/G) \to \text{sec}(X/G\times Y/G\to X/G) $$ induced by the fibration $X\times_G Y \to X/G \times Y/G$.
This map of section spaces is the map of fibers which is induced by a map of fibrations over a common base space: the first fibration is $F(X/G, X\times_G Y) \to F(X/G,X/G)$ and the second one is $F(X/G, X/G\times Y/G) \to F(X/G,X/G)$. Since the map $F(X/G, X\times_G Y) \to F(X/G, X/G\times Y/G)$ is a fibration, it is formal to show that the map of section spaces is too.
In your situation we take $X = P$ and $Y = EG$. Then we see that the map $$ F(P,EG)^G \to F(P/G,BG) $$ is a fibration. The fiber at the point of $F(P/G,BG)$ defined by the classifying map for $P \to P/G$ is then your gauge group $\cal G$.