Extensions of short exact sequences and second cohomology group Let $G=\mathbb{I}_{p}=<g>$ be the cyclic group of order $p$, where $p$ is a prime and $A=\mathbb{Z}_{p}\oplus\mathbb{Z}_{p}$ a $G-$ module with the action $g^{n}(x,y)=(x+ny,y)$. I want to show that for $p=2$ all the short exact sequences of the form $$1\longrightarrow A\longrightarrow E\longrightarrow G\longrightarrow1$$ split and for $p\neq2$ to construct a non-split sequence of the form $$1\longrightarrow A\longrightarrow E\longrightarrow G\longrightarrow1$$ I have calculated  $H^{2}(G,M)=0$ for $p=2$ and $H^{2}(G,M)=\mathbb{Z}_{p}$ for $p\neq2$, so I know that the above statement is true, but I can't show it. Any help? Thank you.
 A: Well you showed it when you computed $H^2(G, A)$! (I think notations got a bit mixed up and $M = A$, right?) It might help to look at the proof of the relation between $H^2$ and extensions, so let's do it.
Take a short exact sequence $1 \to A \xrightarrow{i} E \xrightarrow{p} G \to 1$. Since $p$ is surjective it has a set-theoretical section (which is not necessarily a group morphism!) $s : G \to E$ such that $p \circ s = \operatorname{id}_G$. Then for all $g \in G$, $p^{-1}(g) = A \cdot s(g)$, so:
$$E = p^{-1}(G) = \bigsqcup_{g \in G} p^{-1}(g) = \bigsqcup_{g \in G} A \cdot s(g) \cong A \times G.$$
(The $\cong$ is just a bijection, not a group isomorphism.)
Since $p(s(g) s(h)) = p(s(g)) p(s(h)) = gh$, it follows that $s(g)s(h) \in p^{-1}(gh)$, so there is an element $\alpha_s(g,h) \in A$ such that
$$s(g) s(h) = \alpha_s(g,h) s(gh).$$
Now the product $s(g)s(g')s(g'')$ is associative, and if you write down what it means, you will see that it is equivalent to $\alpha_s : G \times G \to E$ being a $2$-cocycle! (And here you really need to use that the short exact sequence is a sequence of $G$-modules, something that you didn't mention.)
Conversely, given such a $2$-cocycle $\beta$, you can define a product on the set $A \times G$:
$$(a,g) \cdot (a', g') := (a g a' \beta(g,g'), gg').$$
You then get a $G$-module $E_\beta$ and a short exact sequence $1 \to A \to E_\beta \to G \to 1$. If you apply the previous construction with the section $s : g \mapsto (1,g) \in A \times G$, you get back a $2$-cocycle $\alpha_s$ which is cohomologous to $\beta$ (verify it).
Now if $\beta$ is a coboundary, the section of the projection $A \times G \to G$, $g \mapsto (1, g)$ becomes a group homomorphism. In fact, it's equivalent to $\beta$ being a coboundary. So if you know that $H^2(G,A) = 0$, then every cocycle is a coboundary and there always exists a splitting of the short exact sequence.
Conversely, suppose $\beta$ is not a coboundary (ie. $[\beta] \in H^2(G, A)$ is nonzero). Then if the short exact sequence. were split with section $s$, you could apply the construction to get a cocycle $\alpha_s$, cohomologous to $\beta$. The fact that you applied the construction to a split short exact sequence. means that $\alpha_s$ is a coboundary, and since $\alpha_s \sim \beta$, $\beta$ is a coboundary too. Contradiction: the short exact sequence cannot be split. So if you choose $[\beta] \neq 0 \in H^2(G,A)$, you can construct the non-split short exact sequence $1 \to A \to E_\beta \to G \to 1$.
