Universal property of universal bundles. A classifying space for a group $G$ is a topological space $BG$ with a principle
$G$-bundle $p : EG \to BG$ where $EG$ is contractile, so that $BG = EG/G$. A classifying space is universal in the sense that if $q : E \to B$ is a principle $G$-bundle, then there is a
continuous map $B \rightarrow BG$, unique up to homotopy, such that $E$ is the fiber product $f^*EG$. Why this definition implies tha there is a one-to-one corrispondence between the isomorphism classes of $G$-bundle on a space $X$ (that I denote with $\mathcal{P}_G(X)$) and the homotopy classes of maps $X \to BG$ ([X,BG])? In practice, how can I show that
$$ [\mathcal{P}_G(X)] \simeq [X,BG] $$
 A: This is explained in a fair amount of detail in Lectures 5-7 here: http://www.math.iupui.edu/~dramras/697.html
To obtain surjectivity, one uses a cell-by-cell argument to construct a classifying map from a given bundle $P\to X$ into $EG$.  The argument is facilitated by a trick: a bundle map like this is the same thing as a section of the "mixed" bundle $P\times_G EG\to X$, whose fibers are the (contractible) space $EG$.
A: The property you described gives you a map
$$
[X, BG] \rightarrow \mathcal{P}_G(X)
$$
that is surjective. 
To check that it is injective, note that if $f: X \rightarrow BG$ and $g: X \rightarrow BG$ correspond to isomorphic bundles over $X$, then we can form a bundle over $X \times I$ by gluing together the bundle on $X \times [0,3/4)$ classified by $f$ and the bundle on $X \times (1/4, 1]$ classified by $g$. This is classified by a map $X \times I \rightarrow BG$ and the restriction to $X \times 0$ and $X \times 1$ is $f$ and $g$, resp., thus giving a homotopy between $f$ and $g$, which is what we wanted.
