Given a (locally small) category $C$, we can take its nerve to obtain a simplicial set $N_\bullet C$, and then take its geometric realization to get a topological space, denoted $BC = |N_\bullet C|$, called its classifying space. This determines a functor $B: \textit{Cat} \to \textit{Top}$.
This construction has some interesting properties:
- It preserves products, i.e. $B(C\times D) = BC\times BD$
- For any topological group $G$ viewed as a category, one has that $BG$ is the bar construction, which classifies principal $G$-bundles
- It sends natural transformations of functors to homotopies of maps
What can be said about the classifying space of a functor category $\text{Fun}(C,D)$? Is it related to the mapping space $\text{Map}(BC,BD)$? Do we have a homotopy equivalence $B\text{Fun}(C,D)\simeq \text{Map}(BC,BD)$?
As Max says, we have a canonical isomorphism $N[C,D]\to [NC,ND]$. However, there is no good relationship between $|[NC,ND]|$ and $[|NC|,|ND|]$ in general. One needs $ND$ to be fibrant, that is, a Kan complex, for this, and that is equivalent to $D$ being a groupoid. For instant, the functor category $(a\cong b)\to (0<1)$ between the walking isomorphism and the walking arrow has two components, but the mapping space between their realizations is contractible.