Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@Fernando : Two points. First, I think that the wikipedia article is flawed in that you also have to assume that the action by $G$ is proper (otherwise, the map $EG \rightarrow BG$ might not be a principal $G$-bundle). Second, if you define it like in the wikipedia article, then it is a theorem that if it exists, then it classifies the functor "principal $G$-bundles", and thus it is not completely obvious that the object that the Brown representability theorem gives you actually satisfies the conditions of the theorem. You need some argument like that given by Oscar or Johannes above.
I don't think it is part of the definition of classifying spaces that $EG$ is contractible. All we know is that $[X,BG]$ is naturally in bijection with the set of principal $G$ bundles on $X$ via the map that takes $\phi : X \rightarrow BG$ to $\phi^{\ast}(EG)$. Of course, it is true that $EG$ is contractible, but I don't know how to see this except via one of the explicit constructions of $BG$. Do you know how to do this?