integral or rational cohomology of real grassmannians I have obtained that the cohomology rings
$$
H^*(G_k(\mathbb{R}^\infty);\mathbb{Z}_2)=\mathbb{Z}_2[w_1,\cdots,w_k].
$$
Also 
$$
H^*(G_k(\mathbb{R}^m);\mathbb{Z}_2)=\mathbb{Z}_2[w_1,\cdots,w_k]/(\bar w_{m-k+1},\cdots,\bar w_{m}).
$$
The inclusion $i: G_k(\mathbb{R}^m)\to G_k(\mathbb{R}^\infty)$ induces a natural quotient map in the above cohomology algebras. 
What are the cohomology rings with integral or rational coefficients
$$
H^*(G_k(\mathbb{R}^\infty);\mathbb{Q})?
$$
$$
H^*(G_k(\mathbb{R}^m);\mathbb{Q})?
$$
$$
H^*(G_k(\mathbb{R}^\infty);\mathbb{Z})?
$$
$$
H^*(G_k(\mathbb{R}^m);\mathbb{Z})?
$$
 A: Let me try to answer the question on integral cohomology of the finite Grassmannians as concretely as possible. 
First I should note that the formula in the question doesn't make sense without additional information. The appropriate formulation is the following: writing the Grassmannian as ${\rm O}(n)/{\rm O}(k)\times {\rm O}(n-k)$ means that we have a fibration
$$
{\rm Gr}_k(\mathbb{R}^n)\to {\rm BO}(k)\times {\rm BO}(n-k)\to {\rm BO}(n),
$$
which exhibits ${\rm Gr}_k(\mathbb{R}^n)$ as the universal space with a pair of real vector bundles $(\mathcal{E},\mathcal{F})$ of ranks $k$ and $n-k$, respectively, such that $\mathcal{E}\oplus\mathcal{F}$ is the trivial rank $n$ bundle. The classifying map ${\rm Gr}_k(\mathbb{R}^n)\to {\rm BO}(k)\times{\rm BO}(n-k)$ induces a homomorphism 
$$
{\rm H}^\bullet({\rm BO}(k)\times{\rm BO}(n-k),\mathbb{Z})\to {\rm H}^\bullet({\rm Gr}_k(\mathbb{R}^n),\mathbb{Z})
$$
and similarly with mod 2 coefficients. For mod 2 cohomology, the Whitney sum formula in the above situation means that $w\cdot \overline{w}=1$, i.e., the product of the total Stiefel-Whitney classes of the two bundles $\mathcal{E}$ and $\mathcal{F}$ is trivial. (This is what the notation in the question means, but I think it is better to write it as $\mathbb{Z}/2\mathbb{Z}[w_i,\overline{w}_j]/(w\cdot\overline{w}-1)$.) The mod 2 statement is easy to find in papers of Borel or Milnor-Stasheff "Characteristic classes".
The point is now that basically the same description works for the integral cohomology. From the computations of Brown, we know the cohomology of ${\rm BO}(k)$, see Mark Grant's answer. So we have a couple of relevant characteristic classes: there are Pontryagin classes $p_i$ and Bockstein classes $\beta(w_1^\epsilon w_{2i_1}\cdots w_{2i_l})$ for the bundle $\mathcal{E}$, and similarly Pontryagin classes $\overline{p}_i$ and Bockstein classes $\beta(\overline{w}_{2i_1}\cdots \overline{w}_{2i_l})$ for the bundle $\mathcal{F}$. The natural relations would be $p\cdot\overline{p}=1$ and $\beta(w\cdot\overline{w})=0$, coming from the Whitney sum formula. The relations encoded in $\beta(w\cdot\overline{w})=0$ can be made explicit using the fact that $\beta$ is a derivation. Also, from the rational cohomology we know that there is an additional class $r$ with $r^2=0$ in the cohomology of ${\rm Gr}(k,n)$ when $k(n-k)$ is odd, see my answer to the MO-question on rational cohomology of finite Grassmanians.

The integral cohomology ring is isomorphic to the algebra generated by these characteristic classes modulo the relations holding in the cohomology of ${\rm BO}(k)$ resp. ${\rm BO}(n-k)$ and the above relations resulting from the Whitney sum formula.

Note that there is a slight technical issue concerning the Whitney sum formula for Pontryagin classes, pointed out in Mingcong Zeng's comment. If we simply take all the Chern classes of the complexification then the Whitney sum formula holds just as you would expect. However, the usual definition of Pontryagin classes discards the odd Chern classes because they are 2-torsion. Following this convention then necessitates a more complicated Whitney sum formula, accounting for the missing 2-torsion terms, see Brown's paper on cohomology of ${\rm BO}(n)$ for the exact formula.
For the ring structure: it's clear how to multiply polynomials in Pontryagin classes. For the multiplication of torsion classes, one can use the formulas given in Brown's paper. It follows from the above description that all torsion is 2-torsion, that the reduction mod 2 maps the 2-torsion isomorphically onto the image of ${\rm Sq}^1:{\rm H}^\bullet({\rm Gr}(k,n),\mathbb{Z}/2)\to {\rm H}^\bullet({\rm Gr}(k,n),\mathbb{Z}/2)$ and that the multiplication of any class with a torsion class can thus be computed in mod 2 cohomology.
(Note that there are no Euler classes, these live in cohomology with twisted coefficients. Generally, it is a good idea to also consider coefficients in the twisted local system, then we get the Euler classes and twisted Bockstein classes. Actually, to prove the above claims using an inductive argument following Sadykov, it is necessary to use cohomology with local coefficients.) 
This can be proved using an integral refinement of the arguments in 


*

*R. Sadykov. Elementary calculation of the cohomology rings of real Grassmann manifolds. Pacific J. Math. 289 (2017), no. 2, 443–447.


The basic idea is to use an induction on the index $k$ in ${\rm Gr}(k,n)$, base case being the projective space, via identifications of the tautological sphere bundles over ${\rm Gr}(k-1,n)$ and ${\rm Gr}(k,n)$. Then it is possible to show that the characteristic classes mentioned above generate the cohomology ring and that all torsion is detected on mod 2 cohomology. But to be honest, I don't know of a place in the literature where this would be written properly (for integral cohomology).
A: This is just answer in the very special case of integer cohomology of $\mathbb{R}\mathbb{P}^\infty$ and $\mathbb{R}\mathbb{P}^n$ as asked in one of the comments.
$\mathbb{R}\mathbb{P}^\infty$ can be divided into cells $\mathbb{R}\mathbb{P}^k\backslash
\mathbb{R}\mathbb{P}^{k-1}=\mathbb{R}^k$, namely one cell in each dimension. The differentials are either 0 or multiplication by 2, depending on parity of the dimension. The cell complex computing integer cohomology is
$$\mathbb{Z}\overset{0}{\to}\mathbb{Z}\overset{2}{\to}\mathbb{Z}\overset{0}{\to}\mathbb{Z}\overset{2}{\to}\dots$$
Hence the integer cohomology groups are
$$H^0=\mathbb{Z}, H^1=0,H^2=\mathbb{Z}/2\mathbb{Z}, H^3=0,H^4=\mathbb{Z}/2\mathbb{Z},\dots.$$
For the space $\mathbb{R}\mathbb{P}^n$ the above complex should be truncated at degree $n$. Then it is equally easy to compute its cohomology.
In general, real Grassmannians can be decomposed into real Schubert cells. But I do not know whether the corresponding cell complex can be used to compute the cohomology.
A: A good reference for the integral cohomology of $BO(k) = G_k(\mathbb{R}^\infty)$ is 
Brown, Edgar H., Jr.
The cohomology of BSOn and BOn with integer coefficients. 
Proc. Amer. Math. Soc. 85 (1982), no. 2, 283–288. 
From this you should be able to work out the rational cohomology, using the universal coefficient theorem (the answer is as in Qiaochu's comment). I don't know a good reference for the finite Grassmannians, but you should be able to get an approximate answer by thinking about which characteristic classes must vanish for dimensional reasons.
A: Some precise recent references for the cohomology of the usual real grassmannians :

*

*Glück, Morgen & Ziller: Calibrated geometries in Grassmann manifolds. Comment. Math. Helv. 64 (1989), no. 2, 256–268 (http://dx.doi.org/10.5169/seals-48945) (cf. page 267).


*Carlson: The Borel equivariant cohomology of real Grassmannians, 2016. arXiv:1611.01175. (cf. Corollary 3.1)


*He : LOCALIZATION OF EQUIVARIANT COHOMOLOGY RINGS OF REAL GRASSMANNIANS https://arxiv.org/pdf/1609.06243.pdf (cf. Corollary 5.26 & Corollary 6.22)
