Let $K(G,n)$ be the Eilenberg Maclane space.
Consider the map from $$ K(\mathbb{Z}_2,1) \to K(\mathbb{Z}_4,1) \overset{f}{\to} K(\mathbb{Z}_2,1)\overset{g}{\to}K(\mathbb{Z}_2,2) \to \dots, $$
It looks that we can represent the map from $K(\mathbb{Z}_2,1)\to K(\mathbb{Z}_2,2)$ relating to the generator of cohomology group $$ q \in H^2(K(\mathbb{Z}_2,1),\mathbb{Z}_2)=H^2(B\mathbb{Z}_2,\mathbb{Z}_2)=\mathbb{Z}_2. $$
Say $$ p \in H^1(K(\mathbb{Z}_2,1),\mathbb{Z}_2)=H^1(B\mathbb{Z}_2,\mathbb{Z}_2)=\mathbb{Z}_2, $$ then $q$ and $p$ are group cocycles related by $$ q = p \cup p. $$
Roughly, say due to the exact sequence above, we may say the kernel (in $K(\mathbb{Z}_2,1)$) of the map $g$, such that $$ q = p \cup p =0, $$ matches the image (in $K(\mathbb{Z}_2,1)$) of $$ f. $$
Can we see explicitly that $q = p \cup p$ may be non-zero in $H^2(K(\mathbb{Z}_2,1),\mathbb{Z}_2)=H^2(B\mathbb{Z}_2,\mathbb{Z}_2)=\mathbb{Z}_2$, but $q =0$ when we pull back via $f$ from the $K(\mathbb{Z}_2,1)$ to $K(\mathbb{Z}_4,1)$? Can this be demonstrated explicitly at the level of group cocycle?