A Lie Group Homomorphism $f:G\to H$ Induces a Functor from Principal $G$-Bundles to $H$-Bundles I am trying to understand Qiaochu Yuan's answer to this question.
The first line of the answer reads:

A Lie group homomorphism $f:G\to H$ induces a functor from the category of principal $G$-bundles to the category of principal $H$-bundles (explicitly, apply $f$ to Cech-cocyles)

I don't know about Cech-cocyles. So I tried the following:
First, I know the following theorem:

Theorem. Let $\pi:P\to M$ be a surjective smooth submersion and $H$ be a Lie group acting freely on $P$ such that the orbit of any $x\in P$ is precisely $\pi^{-1}(\pi(x))$. Then $\pi:E\to M$ is a principal $H$-bundle.

So if we are given a Lie group homomorphism $f:G\to H$ and a principal $G$-bundle $\pi:E\to M$, we need to come up with a principal $H$-bundle.
I tried to define an action of $H$ on $P$ as follows: $f(g)\cdot x=g\cdot x$
for all $x\in P$. If $f$ were a Lie group isomorphism, then this works. But if $f$ is not an isomorphism then this action may not even be well defined. Also, if $f$ is not surjective then this does not define an action of $H$ on $P$ anyway.
So can somebody elucidate how do we get the required functor?
 A: There are (at least) two ways to do this. 
One way is by using transition functions. Let $\{U_\alpha\}$ be an open cover of $M$ such that $P$ is trivial over each $U_\alpha$, and let $\tau_{\alpha\beta}\colon U_\alpha\cap U_\beta \to G$ be the corresponding transition functions. Define new transition functions $\sigma_{\alpha\beta}\colon U_\alpha\cap U_\beta\to H$ by $\sigma_{\alpha\beta} = f\circ\tau_{\alpha\beta}$.  These satisfy the cocycle condition: For all $x\in U_\alpha\cap U_\beta\cap U_\gamma$, $\sigma_{\alpha\beta}(x)\sigma_{\beta\gamma}(x) = \sigma_{\alpha\gamma}(x)$ (which follows from the cocycle condition for $\{\tau_{\alpha\beta}\}$), and thus can be used to construct a principal $H$-bundle $\widetilde P\to M$ that is trivial over each $U_\alpha$ and has $\{\sigma_{\alpha\beta}\}$ as transition functions. (The construction goes like this: Start with the disjoint union of the trivial bundles $U_\alpha\times H$, and then take the quotient by the equivalence relation generated by declaring $(x_\alpha,h_\alpha)\in U_\alpha\times H$ equivalent to $(x_\beta,h_\beta)\in U_\beta\times H$ if $x_\alpha=x_\beta\in U_\alpha\cap U_\beta$ and $h_\beta = \tau_{\alpha\beta}(x_\alpha)h_\alpha$. This is what Yuan was referring to when he mentioned Čech cocycles.) Given a $G$-bundle morphism $\Phi\colon P\to P'$ covering a map $\phi\colon M\to M'$, we can define an associated $H$-bundle morphism $\widetilde \Phi\colon \widetilde P\to \widetilde P'$ by $\widetilde\Phi[x_\alpha,h_\alpha] = [\phi(x_\alpha),f(h_\alpha)]$, where the brackets represent equivalence classes. This yields a functor $P\mapsto \widetilde P$, $\Phi\mapsto \widetilde \Phi$.
A more invariant way to do it is based on the associated bundle construction. Define an equivalence relation on $P\times H$ by 
$$
(p,h) \sim (pg^{-1}, f(g)h), \qquad g\in G,
$$
and let $\widetilde P$ be the quotient space of $P\times H$ under this equivalence relation. For each $(p,h)\in P\times H$, let $[p,h]$ denote its equivalence class in $\widetilde P$. There is a well-defined projection $\widetilde \pi\colon \widetilde P\to M$ given by $\widetilde \pi[p,h] = \pi(p)$, whose fibers are homeomorphic to $H$. There is a right action of $H$ on $\widetilde P$ given by $[p,h]\centerdot h' = [p,hh']$, which is easily seen to be well-defined, free, and transitive on fibers. This turns $\widetilde P$ into a principal $H$-bundle over $M$. For any $G$-bundle morphism $\Phi\colon P \to P'$, the associated $H$-bundle morphism $\widetilde \Phi\colon \widetilde P\to \widetilde P'$ is defined by $\widetilde \Phi[p,h] = [\Phi(p),f(h)]$.
A: It seems that he was thinking about cohomology theory with coefficient change, and if this is what Cech cocycle means, then the functor should be the push-forward
$f_*:\mathrm{H}^*_\mathrm{Cech}(B,G)\rightarrow\mathrm{H}^*_\mathrm{Cech}(B,H)$
