Cohomology classes annihilated by pullbacks A friend of mine is interested in examples of the following situation:
an oriented smooth fiber bundle $\pi \colon M \to B$ with $M$ and $B$ compact 
and a non-zero class $a \in H^3(B; \mathbb{Q})$
such that $\pi^* a=0$  in $H^3(M; \mathbb{Q})$. 
It is easy to construct such an example if the class $a$ is a product of a degree $1$ class and degree $2$ class; are there examples not of this kind?
 A: This is a update of my comments above. As I am unable to construct a requested example, I go in the opposite direction and describe what definitely cannot be an example.
Standing assumptions are that $\pi:M\to B$ is a fibration with homotopy fiber $F$, the spaces $F$, $B$ are path-connected finite CW-complexes, and the fibration is homologically simple over $\mathbb Q$. 


*

*A basic fact is that if the cohomological (rational) Serre spectral sequence of the bundle collapses at $E_2$, then $\pi^*: H^k(B;\mathbb Q)\to H^k(M;\mathbb Q)$ is injective. A well-known conjecture due to Halperin states that the Serre spectral sequence collapses if $F$ is rationally elliptic with positive Euler characteristic. 
Recall that
rationally elliptic means that $F$ is simply-connected and all but finitely many homotopy groups $\pi_i(F)$ are finite. For example any homogeneous space $G/H$ where $G$, $H$ are compact Lie group is rationally elliptic, and if $G, H$ have equal rank, then $G/H$ has positive Euler characteristic. Examples include products of even-dimensional spheres or complex/quaternion projective spaces. Halperin's conjecture has been verified for $G/H$ of equal rank. Thus in the example asked by Petya the fiber cannot be $G/H$ of equal rank. 

*A much easier argument shows that the fiber cannot be an odd-dimensional sphere. Indeed, it follows from Gysin sequence that the kernel of $\pi^*: H^3(B;\mathbb Q)\to H^3(M;\mathbb Q)$ is injective except possible when $F=S^1$ in which case the kernel is a multiple of the Euler class, i.e. it factors as the product of $1$-dimensional and $2$-dimensional classes.

*Suppose $H^i(B ;\mathbb Q) = 0=H^j (F;\mathbb Q)=0$ for $i < n$,  $\ j< m$, and 
$m+n=4$, then the kernel of $\pi^*: H^3(B;\mathbb Q)\to H^3(M;\mathbb Q)$ is the image
of the transgression $H^2(F;\mathbb Q)\to H^3(B;\mathbb Q)$, which can also be interpreted as the first obstruction the existence of a section of the fibration on the $3$-skeleton.
Thus $F$ cannot be rationally $2$-connected (in which case $n=1$ and $m=3$).
A: The Becker--Gottlieb transfer implies that $\pi^*$ is rationally a (split) monomorphism unless the Euler characteristic of the fibre is zero. Thus any proposed example must have this property.
A: All I was able to came up with is the following.


*

*If the fiber $F$ and $M$ are not required to be manifolds and we allow $\pi:M\to B$ to be a Serre fibration, then such bundles obviously exist: take $B=S^3$, pick a base point in $B$ and take the path fibration that associates the end point to a path in $B$ that starts at the base point.

*If the base of a locally trivial bundle is $S^3$ and the structure group can be reduced to a Lie group, then the bundle is trivial, essentially because the sphere is made of two 3-balls with intersection $=S^2$ and $\pi_2$ of any Lie group vanishes. So if $B=S^3$ and the structure group is a Lie group, then the map of $H^3$'s with rational coefficients induced by the bundle projection is injective. I think I know how to prove this for any base $B$ which is a manifold.

*If one works modulo 2 rather than over the rationals, then there are plenty of examples: take e.g. the principal tautological bundle over the Grassmannian of 3-planes in $\mathbf{R}^n$ for $n$ sufficiently large. 
A: Here's my two cents although it's rather sketchy.
For any CW complex $X$, $H^3(X;\mathbb{Z})=[X,K(\mathbb{Z},3)]$, where $K(\mathbb{Z},3)$ comes equipped with a fibration $\mathbb{CP}^\infty\to P\to K(\mathbb{Z},3)$. The total space $P$ is contractible. Now suppose $X$ is a compact manifold of dimension $n$ which is $2$-connected and $H^3(X;\mathbb{Z})=\mathbb{Z}$. Then choosing a generator of $H^3(X;\mathbb{Z})$ corresponds to a (homotopy class of) map $f:X\to K(\mathbb{Z},3)$. The pullback bundle $f^\ast P\to X$ has the property that $H^3(f^\ast P;\mathbb{Z})=0$. 
Since we need a finite dimensional manifold which $f^\ast P$ isn't, let $E$ denote the $(n+5)$-skeleta of $f^\ast P$. It is compact and locally looks like $X\times\mathbb{CP}^2$. I think(?) that $\pi:E\to X$ is a fibre bundle. Since $\pi_3$ is unchanged for $4$-skeleta or higher, it follows that $0=\pi_3(E)=\pi_3(f^\ast P)$, whence $H^3(E;\mathbb{Z})=0$.  
Feel free to tweak the answer if need be.
Edit  As pointed out by algori and Igor, the second paragraph doesn't give you a fibre bundle. 
A: There's an example of a smooth but infinite-dimensional fibre bundle $M \to S^3$ with $H^3(M)=0$. It involves some ideas that algori and Somnath Basu have already noted.
The fibre is $\mathbb{P}(H)$, projective infinite-dimensional separable complex Hilbert space. Kuiper's theorem that $U(H)$ is contractible in the operator-norm topology has the well-known consequence that $PU(H)$ is a $K(\mathbb{Z},2)$. Take as clutching function for such a bundle $M\to S^3$ a smooth map $S^2\to PU(H)$ representing a generator of $\pi_2 PU(H) \cong \mathbb{Z}$. Then $M$ is 3-connected by the homotopy exact sequence of the fibration, so has vanishing $H^3$ by Hurewicz.
Since $\pi_2 G =0$ for $G$ a finite-dimensional Lie group (in particular, $PU_n$), this bundle isn't the stabilisation of a finite-dimensional projective vector bundle. 
To find an example over $S^3$ (or more generally, one that is trivial over the 2-skeleton) with compact smooth fibre $F$, you'll need $\pi_2 Diff(F)\otimes \mathbb{Q} \neq 0$. One can't take $F$ to a surface; I wonder if anything is known about $\pi_2 Diff(\mathbb{CP}^n)$ for $n>1$. 
Added: More precisely, one needs $\pi_2 Diff_0(F)\otimes \mathbb{Q}$ to have non-zero image in $\pi_2 Aut_0(F)\otimes \mathbb{Q}$, where $Aut_0(F)$ is the identity component of the space of self-homotopy equivalences. As shown in a paper noted by Igor Belogradek in his comments above, "Rational type of classifying spaces for fibrations" by Samuel B. Smith, this fails when $F=\mathbb{CP}^n$.
A: Here's another way to look at it, essentially a variation of Tim's comment: a smooth fiber bundle $M$ over $B$ with fiber $F$ is defined by a map $B\to BDiff(F)$. A class $a\in H^3(BDiff(F);Q)$ will always pull back to zero in $H^3(M;Q)$. Since any class in $H_3(-,Q)$ of any space is, after taking multiples if necessary, represented by a 3-dimensional bordism class, you might as well assume that $B$ is a compact oriented 3-manifold. Since the fundamental class of a 3-manifold is not a product of   1 and 2 diml classes iff $B$ is a rational homology sphere, this tells you what you are looking for is a manifold $F$ and a class in $H_3(BDiff(F);Q)$ represented by a map from a 
Q homology 3-sphere.  As Tim points out, if the Hurewicz map $\pi_3(BDiff(F))\to H_3(BDiff(F))$ is rationally non-zero you can take $B=S^3$, but since many Q homology 3-spheres are aspherical this may give you additional flexibility. 
A: Ignore this answer.
