What is the $\mathbb Z/2$-cohomology of $\mathrm B^n(\mathbb Z/2)$? I would like to know the cohomology groups $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$.  I assume that this is a standard computation, but I'm not sure where to look up the answer (and, not being a great algebraic topologist, I'm not sure how to do the computation myself).
Note that by induction $\mathrm B^{n-1}(\mathbb Z/2)$ is an $E_\infty$ group, so $\mathrm B^n(\mathbb Z/2) = \mathrm B(\mathrm B^{n-1}(\mathbb Z/2))$ exists, and is an $E_\infty$ group.  Thus $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$ is a Hopf algebra.  By Hurewicz theorem, it begins (in dimensions) $1, 0,\dots,0,1,\dots$, where the first cohomology class occurs in degree $n$.  I assume that the whole $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$ is $(\mathbb Z/2)[x]$ where $x$ has cohomological degree $n$, so that $B^n(\mathbb Z/2)$ has cohomology precisely in the multiples of $n$.  The latter statement is true for $n=0$ (although the description qua polynomial algebra needs modification), and my whole assumption does hold when $n=1$.
Note also that $B^n(\mathbb Z/2)$ classifies $\mathrm H^n(-;\mathbb Z/2)$, so I'm equivalently asking:

What is the set $\pi_0\mathrm{maps}(B^n(\mathbb Z/2),B^m(\mathbb Z/2))$?

 A: The ring $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$ is not a polynomial ring on one generator for $n>1$. The spaces $B^n(\mathbb Z/2)$ often called the Eilenberg McLane spaces and is denoted by $K(\mathbb{Z}/2, n)$. In some sense, the 'limit$^{*}$' (as a vector space and not as a ring)$$\underset{n \to \infty}{\lim} \mathrm \Sigma^{-n} H^{\bullet}(K(\mathbb{Z}/2, n); \mathbb{Z}/2)$$ where $\Sigma^{-1}$ is simply shifting the grading, is the Steenrod algebra which is described in terms of squaring operations.
The rings $\mathrm H^\bullet(\mathrm K(\mathbb Z/2, n);\mathbb Z/2)$ are defined in terms of 'admissible basis' using squaring operations where the 'excess' is less than $n$. There are a lot of books that describe these in details. Notes on these computations are available online for example,
here.
($^{*}$One can be more precise about this limit using the language of spectrum, a world where suspension operation is invertible. The spaces $K(\mathbb{Z}/2, n)$
are building blocks for the spectrum $H\mathbb{Z}/2$ and the Steenrod algebra is the homotopy class of maps $$[H\mathbb{Z}/2, H\mathbb{Z}/2 ]_*$$ where the algebra structure comes from the composition.)
A: All cohomology in this answer will have $\mathbb{Z}/2$ coefficients, and $K_n$ will denote $B^n(\mathbb{Z}/2)$.  By the Yoneda lemma, the cohomology $H^m(K_n)$ can also be thought of as the natural operations that take a cohomology class in degree $n$ on a space and give a cohomology class in degree $m$.  As you note, the identity gives a canonical element $\iota_n\in H^n(K_n)$, and cup powers give further classes $\iota_n^k\in H^{nk}(K_n)$.  However, it is not true for $n>1$ that $H^*(K_n)$ is $\mathbb{Z}/2[\iota_n]$: there are other operations as well, namely Steenrod squares.  It turns out that all of $H^*(K_n)$ is generated by $\iota_n$ under Steenrod squares and cup products, and that it is freely generated in the sense that it is initial among graded commutative $\mathbb{Z}/2$-algebras containing a class $\iota_n$ in degree $n$ with an action of Steenrod squares that satisfies certain relations (specifically, these relations describing how Steenrod squares interact with the grading and the ring structure and these relations regarding the composition of Steenrod squares).  As a commutative $\mathbb{Z}/2$-algebra, it turns out that $H^*(K_n)$ is a polynomial ring on the expressions of the form $Sq^{k_1}\dots Sq^{k_m}\iota_n$ such that $k_i\geq 2k_{i+1}$ for each $i$ and $\sum k_i-2k_{i+1}<n$ (where $k_{m+1}$ is taken to be $0$).  In particular, for $n>1$, there are infinitely many such expressions, so $H^*(K_n)$ is a rather large ring.  Finally, the Hopf algebra structure is very easy to compute: the $H$-space structure map $K_n\times K_n\to K_n$ represents addition of cohomology classes and the Steenrod squares are linear, and so all of the polynomial generators are primitive.
This computation of $H^*(K_n)$ can be done by induction on $n$ using the Serre spectral sequence and the fact that the Steenrod squares commute with the transgression map of the Serre spectral sequence (in fact, I believe this was one of Serre's original applications of the spectral sequence).  A nice reference for all of this is Mosher and Tangora's little book Cohomology Operations and Applications in Homotopy Theory.  If you want more references, some good terms to google are "cohomology of Eilenberg-Mac Lane spaces", "Steenrod algebra", and "admissible sequence".
