Classifying map of a principal bundle Given a topological group, say $G$, it is well known that the classifying space $BG$ classifies $G$ principal bundles. Under some mild assumption on $G$, one model of $BG$ is the geometric realization of the nerve of the one object groupoid $G⇉*$.
Let $P\to M$ be a $G$ principal bundle. We can form the action groupoid $P\rtimes G=\{P\times G⇉ P\}$, whose nerve is also the bar construction. There are natural groupoid morphisms $P\rtimes G\to G⇉*$, and $P\rtimes G\to \underline{M}$, where $\underline{M}$ is the trivial groupoid.
Taking the nerve and then taking geometric realization, we obtain a map
$$|N_\bullet （P\rtimes G）|\to BG.$$
Notice that $N_\bullet (P\rtimes G)\to N_\bullet \underline{M}$ is acyclic, thus we have a map
$$M\to BG$$
up to homotopy. 
My question is that: whether this map is the classifying map for the $G$-principal bundle $P\to M$? 
Since all the maps are so natural, I would expect the answer should be yes. However, I did not find the relevant relevant reference.
Thanks a lot.
 A: If $M$ is paracompact, or more generally $P$ is trivialised over a numerable open cover, this map is indeed the classifying map for $P\to M$. Note that the universal bundle $EG \to BG$ is given by the geometric realisation of $G\rtimes G \to \ast \rtimes G$, since you are assuming $G$ well-pointed (so that $|N (\ast \rtimes G)| \simeq BG$). 
So to show that $M\to BG$ as you give is the classifying map, it is enough to show that $P\times_M N \simeq c^\ast EG$, where $N:= |N(P\rtimes G)|$ and $c\colon N\to BG$. Since $M$ is paracompact, $N\to M$ is shrinkable, and hence a homotopy equivalence. Thus given a section, pulling $P\times_M N$ back along this section gives a bundle isomorphic to $P$, as pullback along homotopic maps (in case the identity, and pulling up then back down) gives isomorphic bundles, which gives the result that $M\to BG$ classifies $P$.
Now assuming that we use the k-space product, or that all the spaces involved are locally compact weak Hausdorff, then geometric realisation of simplicial spaces preserves pullbacks. Thus $c^\ast EG$ is given by the geometric realisation of the nerve of $(P\rtimes G) \times_{(\ast\rtimes G)} (G\rtimes G)$, and $P\times_M N$ by the geometric realisation of the nerve of $\underline{P}\times_\underline{M}(P\rtimes G)$. Thus we only need to show that there is an isomorphism of groupoids
$$
(P\rtimes G) \times_{(\ast\rtimes G)} (G\rtimes G) \simeq (P\times G) \rtimes G \to \underline{P}\times_\underline{M}(P\rtimes G) \simeq (P\times_M P) \rtimes G,
$$
where the action in $(P\times G) \rtimes G$ is diagonal, and the action in $(P\times_M P) \rtimes G$ is on the right factor of $P$ only.
The map on the level of objects is just 
$$
P\times G \to P\times_M P,
$$
sending $(p,g) \mapsto (p,pg)$, and by principality of the action this is an isomorphism. The map on the level of arrows is 
$$
P\times G \times G \to P\times_M P \times G
$$
sending $(p,g_1,g_2) \mapsto (p,pg_1,g_2)$, again an isomorphism. It is not too difficult to see that this is funtorial, and so we get an isomorphism of geometric realisations as desired.
As far as a reference is concerned, Segal's paper Classifying spaces and spectral sequences, Publications Mathématiques de l'IHÉS, 34 (1968), p. 105-112  (Numdam) is probably the best, though he doesn't give the direct argument from above, using instead cocycles for an open cover (if you think of the space P as a cover over which the bundle P trivialises, then his argument can be applied to recover the above).
A: Using the language of the two-sided bar construction, one can
see the classifying map as follows.  There is an evident natural
zigzag of maps of principal $G$-bundles
$$ P \longleftarrow  B(P,G,G) \longrightarrow B(\ast, G,G) = EG $$
over the zigzag of base space maps
$$ P/G \longleftarrow B(P,G,\ast) \longrightarrow B(\ast,G,\ast) = BG. $$
It is standard that the top left arrow is a homotopy equivalence,
and it follows trivially that the bottom left arrow is a weak 
homotopy equivalence and therefore a homotopy equivalence if the
spaces in sight have the homotopy types of CW complexes. One can obtain an inverse map $P/G\longrightarrow B(P,G,\ast)$ assuming only that $P/G$, not necessarily $G$, has the homotopy type of a CW complex. This gives
the required classifying map.  This
argument is explicit in my 1975 AMS Memoir "Classifying spaces and
fibrations" http://www.math.uchicago.edu/~may/BOOKS/Classifying.pdf
(see the diagram on page 49).  The main point there is the generalization
to ``principal fibrations'' and related classification theorems, which
are all proven in exactly the same way.  The result is not written in terms 
of your categories, since that would obscure the generalizations, but
the interpretation is evident.  One doesn't need to assume numerability,
but that drops out since the universal bundle is itself numerable (See Theorem 8.2 op cit).
