Examples and properties of spaces with only trivial vector bundles Let $B$ be a paracompact space with the property that any (topological) vector bundle $E \to B$ is trivial. What are some non-trivial examples of such spaces, and are there any interesting properties that characterize them?
For simple known examples we of course have contractible spaces, as well as the 3-sphere $S^3$. This one follows from the fact that its rank $n$ vector bundles are classified by $\pi_3 (BO(n)) = \pi_2 (O(n)) = 0$. I'm primarily interested in the case where $B$ is a closed manifold. Do we know any other such examples?
There is this nice answer to a MSE question which talks about using the Whitehead tower of the appropriate classifying space to determine whether a bundle is trivial or not. This seems like a nice tool (of which I am not familiar with) to approaching this problem. As a secondary question, could I ask for some insight/references to this approach?
EDIT Now that we know from the answers all the examples for closed $3$-manifolds, I guess I can now update the question to the case of higher odd dimensions. Does there exist a higher dimensional example?
 A: Let $B$ be a closed manifold with such that every vector bundle is trivial. Then $H^1(B; \mathbb{Z}_2) = 0$, otherwise there would be a non-trivial line bundle. Therefore every bundle over $B$ is orientable and $B$ itself is orientable. Orientable rank two bundles over $B$ are classified by $H^2(B; \mathbb{Z})$, so we must have $H^2(B; \mathbb{Z}) = 0$. It follows these conditions that there are no examples with $\dim B = 1, 2$. If $\dim B > 2$ we then have to consider the possibility of non-trivial bundles of rank at least three.
Suppose now that $\dim B = 3$. As $B$ is closed and orientable we have $H_1(B; \mathbb{Z}) \cong H^2(B; \mathbb{Z}) = 0$ by Poincaré duality and $H^3(B; \mathbb{Z}) \cong \mathbb{Z}$. It follows that $B$ is an integral homology sphere - note, the condition $H^1(B; \mathbb{Z}_2) = 0$ is superfluous in this case as $H^1(B; \mathbb{Z}) \cong \operatorname{Hom}(H_1(B; \mathbb{Z}), \mathbb{Z}_2)$ by the Universal Coefficient Theorem. We still have to consider the possibility of non-trivial bundles of rank at least three.
Suppose $E \to B$ has rank greater than three, then $E\cong E_0\oplus\varepsilon^k$ for some rank three bundle $E_0$, see this answer; in particular, we only need to consider the possibility of a non-trivial vector bundle of rank three. Suppose then that $\operatorname{rank} E = 3$. As $E$ is orientable, it has an Euler class $e(E)$ which is the first obstruction to a nowhere-zero section (it is also the only obstruction because $\operatorname{rank}E = \dim B$). As $E$ has odd rank, the Euler class of $E$ is two-torsion, but $e(E) \in H^3(B; \mathbb{Z}) \cong \mathbb{Z}$ which is torsion-free, so $e(E) = 0$. Therefore $E \cong E_0\oplus\varepsilon^1$ where $\operatorname{rank}E_0 = 2$. As we already know rank two bundles over $B$ are trivial, we see that $E$ is also trivial.
In conclusion, we have the following:

Let $B$ be a closed three-manifold. Every vector over $B$ is trivial if and only if $B$ is an integral homology sphere.

Note, we only considered real vector bundles above, but the same is true for complex vector bundles since every such bundle is the direct sum of a trivial bundle and a complex line bundle, but the latter are classified by $H^2(B; \mathbb{Z}) = 0$.
The fact that every vector bundle over a three-dimensional integral homology sphere is trivial can also be seen using Quillen's plus construction (also see section $\mathrm{IV}.1$ of Weibel's An Introduction to Algebraic K-Theory). As $B$ is an integral homology sphere, its fundamental group $\pi_1(B)$ is perfect. By the plus construction, there is a simply connected CW complex $B^+ = B^+_{\pi_1(B)}$ and a map $q : B \to B^+$ inducing isomorphisms on homology satisfying the following: if $f : B \to X$ is a map with $\ker f_* : \pi_1(B) \to \pi_1(X)$ equal to $\pi_1(B)$, then there is a map $g : B^+ \to X$, unique up to homotopy, such that $f = g\circ q$. As $H^1(B; \mathbb{Z}_2) = 0$, every bundle over $B$ is orientable and hence classified by a map $f : B \to BSO(n)$. Since $\pi_1(BSO(n)) \cong \pi_0(SO(n)) = 0$, the kernel of $f_* : \pi_1(B) \to \pi_1(BSO(n))$ is $\pi_1(B)$ so $f = g\circ q$ for some map $g : B^+ \to BSO(n)$. Note that $B^+$ is a simply connected CW complex with $H_*(B^+) \cong H^+(S^3)$, so $B^+$ is homotopy equivalent to $S^3$ by the homological Whitehead Theorem. As $\pi_3(BSO(n)) \cong \pi_2(SO(n)) = 0$, the maps $g$ and $f$ are nullhomotopic, so $f$ classifies the trivial bundle. Replacing $BSO(n)$ with $BU(n)$ yields the same result for complex vector bundles.
As for higher-dimensional examples, note that they must have odd dimension. To see this, suppose $\dim B = 2m$. Choose a degree one map $\varphi : B \to S^{2m}$ and consider the bundle $\varphi^*TS^{2m} \to B$. As $e(TS^{2m}) \neq 0$ and $\varphi^* : H^{2m}(S^{2m}; \mathbb{Z}) \to H^{2m}(B; \mathbb{Z})$ is an isomorphism, we see that $e(\varphi^*TS^{2m}) = \varphi^*e(TS^{2m}) \neq 0$ and hence $\varphi^*TS^{2m}$ is non-trivial. If one considers complex bundles instead, the same argument works by replacing $TS^{2m}$ with a complex vector bundle $E$ with $e(E) = c_n(E) \neq 0$ - such a bundle always exists as $\operatorname{ch} : K(S^{2m})\otimes\mathbb{Q}\to H^{\text{even}}(S^{2m}; \mathbb{Q})$ is an isomorphism.
One last comment about dimension five. As was established by Jason DeVito here, $B$ must be a rational homology sphere. If a five-dimensional example exists, I claim it is also a $\mathbb{Z}_2$ homology sphere. To see this, first note that we have $H^1(B; \mathbb{Z}_2) = 0$ from above. Now, if $v \in H^2(B; \mathbb{Z}_2)$, then there is a bundle $E \to B$ with $w_2(E) = v$ if and only if $\beta(v^2) \in H^5(B; \mathbb{Z})$ is zero where $\beta$ denotes the mod $2$ Bockstein, see this answer. As $\beta(v^2)$ is two-torsion and $H^5(B; \mathbb{Z}) \cong \mathbb{Z}$ is torsion-free, we see that $\beta(v^2) = 0$ for every $v \in H^2(B; \mathbb{Z}_2)$, so every such class arises as $w_2(E)$ for some $E$. Therefore, we must have $H^2(B; \mathbb{Z}_2) = 0$. The claim now follows by Poincaré duality.
A: Here is one constraint, which seems relevant in light of Michael Albanese's answer:
Claim: Let $B$ be a closed orientable odd-dimensional manifold with no stably nontrivial complex vector bundles. Then $B$ is a rational homology sphere (of odd dimension).
Proof:

*

*By Bott periodicity, $\widetilde{KU}^\ast(B)$ is concentrated in odd dimensions.


*Now, $\widetilde H^\ast(B; \mathbb Q[\beta^\pm])$ (with $|\beta| = 2$) is the rationalization of $\widetilde{KU}^\ast(B)$, so it is also concentrated in odd dimensions. So $\widetilde H^\ast(B; \mathbb Q)$ is also concentrated in odd dimensions.


*Now since $B$ is odd-dimensional, it follows by Poincaré duality that $B$ is a rational homology sphere.
A: Here is another obstruction.

Suppose $M^n$ is a closed simply connected manifold which admits only trivial vector bundles.  Then $M$ cannot be a $\mathbb{Z}/2\mathbb{Z}$-homology sphere, unless $n=3$.

I'm not sure if the hypothesis that $M$ is simply connected is necessary, but it's certainly necessary in the proof.
Together with the end of Michael Albanese's answer, this implies that every simply connected $5$-manifold admits a non-trivial vector bundle.
Proof Sketch:  By the work in the other answers, we already know that if $M$ admits only trivial vector bundles, then $M$ is odd dimensional, orientable, and it has the rational homology of a sphere.  Thus, we may assume $n\geq 5$.
Now, assume for a contradiction that all the torsion in $H^\ast(M)$ is of odd order.
Let $k$ denote the least common multiple of the orders of the torsion and note that $k$ is odd.
Because $M$ is orientable, it has a degree $1$ map $f:M\rightarrow S^n$.  We will construct a non-trivial vector bundle on $M$ by pulling back a non-trivial bundle $E$ over $S^n$ along $f$.  When $n\neq 7$, we may use the tangent bundle $E=TS^n$.  When $n=7$, we let $E$ denote the rank $3$ vector bundle corresponding to a generator of $\pi_7(BO(3))\cong \pi_6(O(3)) = \pi_6(S^3) = \mathbb{Z}/12\mathbb{Z}$.  Let $\phi:S^n\rightarrow BO(s)$ denote the classifying map of the bundle $E$ (where $s = n$ if $n\neq 7$, and $s= 3$ when $n = 7$.)
We claim that $f^\ast E$ is a non-trivial vector bundle over $M$.  To see this, note that since $M$ is simply connected and all torsion is annihilated by $k$, there is a map $g:S^n\rightarrow E$ of degree $k^r$ for some integer $r\geq 1$.  (See the answer here for a proof.)
It is enough to show that $g^\ast(f^\ast E)$ is a non-trivial vector bundle over $S^n$.  Of course, it is enough to show that the map $\phi\circ g\circ f:S^n\rightarrow BO(s)$ is homotopically non-trivial. We'll show this by showing the induced map on $\pi_n$ is non-trivial.
So, consider the induced map on $\pi_n$.  For $n\geq 5$ odd (except $n=7$), Kervaire has shown that $\pi_n(BO(n))\cong \pi_{n-1}(O(n))$ is either $\mathbb{Z}/2\mathbb{Z}$ or $(\mathbb{Z}/2\mathbb{Z})^2$.  When $n\neq 7$, the fact that $E$ is non-trivial implies that $\phi_\ast$  is non-trivial, so, for $n\neq 7$, the kernel of the map $\phi_\ast:\pi_n(S^n)\rightarrow \pi_n(BO(n))$ is the even integers.  On the other hand, by our choice of $E$ when $n=7$, we have $\ker \phi_\ast = 12\mathbb{Z}$.  In either case, the image of $(g\circ f)_\ast:\pi_n(S^n)\rightarrow \pi_n(S^n)$ is multiplication by the odd number $k^r$, so not contained in $\ker \phi_\ast$.  The completes the sketch. $\square$.
