Associated to a vector bundle $\pi:E\to B$ with fibre $\mathbb{R}^n$ is the projective bundle $P(\pi):P(E)\to B$ with fibre $\mathbb{RP}^{n-1}$. However, we have a map $g:E\to \mathbb{R}^\infty$ that is linear injection on each fibre. Projectivizing the map $g$ produces a map $P(g):P(E)\to \mathbb{RP}^\infty$. Let $\alpha$ be a generator of $H^1(\mathbb{RP}^\infty;\mathbb{Z}_2)$ abd let $x=P(g)^*(\alpha)\in H^1(P(E);\mathbb{Z}_2)$.
My question is why the powers $x^i$ for $i=0,\cdots,n-1$ restricting to generators of $H^i(\mathbb{RP}^{n-1};\mathbb{Z}_2)$ in each fibre $\mathbb{RP}^{n-1}$ for $i=0,\cdots,n-1$. (Then the Leray-Hirsch theorem applies.)
Supposed we know that $H^*(\mathbb{RP}^\infty;\mathbb{Z}_2)\cong \mathbb{Z}_2[\alpha]$ and $H^*(\mathbb{RP}^{n-1};\mathbb{Z}_2)\cong \mathbb{Z}_2[\beta]/(\beta^n)$ where $|\alpha|=|\beta|=1$.
It seems that we have $\alpha$ pullbacks to $x$ and $\alpha$ pullbacks to $\beta$, so how does $x$ pullbacks to $\beta$?
There is a little trick for me. Please show me. Thanks very much!
As you say, $\alpha$ pulls back to $x$ and also pulls back to $\beta$ in each fiber. Explicitly, $P(g)^*(\alpha)=x$ and $h^*(\alpha)=\beta$ if $h$ is the composition of the inclusion of a fiber $j:\mathbb{R}P^{n-1}\to P(E)$ and $P(g):P(E)\to \mathbb{R}P^\infty$. Since $h=P(g)j$, $$\beta=h^*(\alpha)=j^*(P(g)^*(\alpha))=j^*(x),$$ which is exactly what you want.