I've come to a non-sense, and I would need some help to understand where I'm doing a mistake.
I'm currently studying the Chern-Weil homomorphism which allows a classification of the principal $G$-bundles for a given $G$. For recall:
For a a principal $G$-bundle $P\longrightarrow M$, take a connection $1$-form $\omega$, and let $\Omega$ be its curvature. Take now the polynomial $f$ of degree $k$ over the Lie algebra $\mathfrak{g}$ of $G$. Then, we obtain the cohomology class $[f\circ \bigwedge^k \Omega]$, which is the class corresponding to $P$ and $f$.
There is then two main points, said in the Chern-Weil theorem: (1)- the result is independent of the choice of the connection. (2) let $g:N\longrightarrow M$ be a morphism, then the pullback bundle $g^* P$ has the cohomology class $g^*[f\circ \bigwedge^k \Omega]$ for $f$.
Here is where I got a problem:
Let us consider any $G$-principal bundle $P\longrightarrow M$, and let $U_i$ be an open covering of $M$ which trivialize the principal bundle. Clearly, we have $\pi: \bigsqcup_i U_i\longrightarrow M$ the projection, and the pullback bundle $\pi^* P= \bigsqcup_i U_i \times G $. This last bundle is trivial, thus contains a flat connection, with by definition the curvature equal to $0$. It implies for any polynomial $f$ over $\mathfrak{g}$ that the cohomological class corresponding to $g^* P$ and $f$ is equal to $[f\circ \bigwedge^k 0]=[0]$. We know furthermore, since it is a pullback bundle, that this $[0]$ is equal to $\pi^* \phi$, where $\phi$ denotes the cohomological class corresponding to $P$ and $f$. But since $\pi$ is a submersion, it follows that $\pi^*$ is an injection. Thus, $\phi=0$.
We conclude thus that the Chern-Weil morphism sends all principle bundles for all polynomial $f$ to $0$, and that it does not classify anything.
Does someone have an idea where I'm doing a mistake?
Thank you in advance!
I'll take a guess and assume that by $\pi$ you mean the base projection $\pi:P\to M$.
I can't see why you assume $P$ to be of the form $\bigsqcup_iU_i$. While one usually constructs the frame bundle of a vector bundle via somewhat like $\bigsqcup_i U_i\times G$, there is missing a factor of $G$ as well as an equivalence relation encoding the non-triviality.