Everything in this question assume the smooth structures.
Suppose a vector bundle $E \rightarrow \mathrm{S}^2\times \mathbb{R}^4$ of rank $r$ satisfies the following condition:
$E_x := E\big|_{\mathrm{S}^2\times \{x\}}$ is trivial for each $x\in \mathbb{R}^4$.
I want to prove that $E$ is trivial as well.
Perhaps some facts in the obstruction theory might be help, but I don't know the theory yet.
Is there a proof or some useful facts to deal with this question?
Thank you.
As I mentioned in the comments, the triviality of $E$ follows from the following (see Theorem $1.6$ of Hatcher's Vector Bundles and K-Theory):
Consider the maps $c : S^2\times\mathbb{R}^4 \to S^2\times\{x\}$, $(p, v) \mapsto (p, x)$, and $i : S^2\times\{x\} \to S^2\times\mathbb{R}^4$, $(p, x) \mapsto (p, x)$. The composition $i \circ c : S^2\times\mathbb{R}^4 \to S^2\times\mathbb{R}^4$, $(p, v) \mapsto (p, x)$ is homotopic to the identity, so $(i\circ c)^*E \cong \operatorname{id}_{S^2\times\mathbb{R}^4}^*E = E$. On the other hand, $(i\circ c)^*E \cong c^*i^*E = c^*E|_{S^2\times\{x\}}$ which is trivial because $E|_{S^2\times\{x\}}$ is trivial by assumption.
The above argument shows that it is enough to know that $E|_{S^2\times\{x\}}$ is trivial for a single $x \in \mathbb{R}^4$ to conclude that $E$ is trivial (and hence $E|_{S^2\times\{x\}}$ is trivial for every $x \in \mathbb{R}^4$). Moreover, by also considering $c\circ i$, the same argument shows that $E$ is trivial if and only $E|_{S^2\times\{x\}}$ is trivial for some (and hence every) $x \in \mathbb{R}^4$.
More generally, if $X$ and $Y$ are paracompact, and $f :X \to Y$ is a homotopy equivalence, then $f^* : \operatorname{Vect}(Y) \to \operatorname{Vect}(X)$ given by $[E] \mapsto [f^*E]$ is a bijection. Here $\operatorname{Vect}(B)$ denotes the set of isomorphism classes of vector bundles on $B$.
Note, I did not specify whether these bundles are smooth or continuous and that's because it doesn't matter. Two smooth bundles are smoothly isomorphic if and only if they are continuously isomorphic. In particular, a smooth bundle is smoothly trivial if and only if it is continuously trivial.