contradiction to characterization of second group cohomology Let $G$ be a group and $A$ be a $G$-module.
In Ken Brown book Cohomology of Groups, on page 93, $H^2(G,A)$ is characterized as the isomorphism classes of group extensions $ 0 \to A \to * \to G$ giving rise to the action $G \curvearrowright A$.
Now when I take $G=\mathbb{Z}/3$ and $A$ to be the trivial $G$ module $\mathbb{Z}/3$, this characterization says that $|H^2(\mathbb{Z/3},\mathbb{Z/3})|=|\mathbb{Z/3}|=3$ is the number of group extensions $ 0 \to \mathbb{Z/3} \to K \to \mathbb{Z/3} \to 0$.
This cannot be correct because any extension group $K$ must have order 9, therefore be abelian and therefore must be either $\mathbb{Z/3} \oplus \mathbb{Z/3}$ or $\mathbb{Z/9}$.  I claim that these gives rise to only 2 isomorphism classes of extensions:
The only subgroups of $\mathbb{Z/3} \oplus \mathbb{Z/3}$ of order $3$ are the ones generated by $(1,0)$, $(0,1)$, $(1,1)$ and there are automorphisms of this group that permute the generators any way one likes.  Hence there is only one isomorphism class of an extension $ 0 \to \mathbb{Z/3} \to \mathbb{Z/3} \oplus \mathbb{Z/3} \to \mathbb{Z/3} \to 0$.
The only subgroups of order $3$ in $\mathbb{Z/9}$ is the one generated by $3 \in \mathbb{Z/9}$.  Hence there is only one isomorphism class of an extension $ 0 \to \mathbb{Z/3} \to \mathbb{Z/9} \to \mathbb{Z/3} \to 0$.
These are inequivalent because the second extension does not split.
Question:  Where is the third extension that the group cohomology calculation predicts?
 A: The point is that given two exact sequences of groups $$ 0 \to \mathbb{Z/3} \to K_1 \to \mathbb{Z/3} \to 0$$ and $$0 \to \mathbb{Z/3} \to K_2 \to \mathbb{Z/3} \to 0$$ such that $K_1\simeq K_2$, this does not necessarily imply that the extensions are equivalent in $H^2(\mathbb Z/3\mathbb Z,\mathbb Z/3\mathbb Z)$. What you need is a commutative diagram
\begin{array}{c}
0 & \to & \mathbb Z/3\mathbb Z& \to& K_1 &\to &\mathbb Z/3\mathbb Z \to &0\\
&&\downarrow&&\downarrow&&\downarrow \\
0 & \to & \mathbb Z/3\mathbb Z& \to& K_2& \to &\mathbb Z/3\mathbb Z  &0  
\end{array}
such that the middle arrow is an isomorphism and the arrows on the left and right are the identity.
In our particular case of $\mathbb Z/9\mathbb Z$, you have two choices for the map $\mathbb Z_3\hookrightarrow \mathbb Z_9$ either take $x+3\mathbb Z$ to $3x+9\mathbb Z$ or to $6x+9\mathbb  Z $. Notice that they both determine the same subgroup $\{0,3,6\}$ in $\mathbb Z/9\mathbb Z$. Now we want an automorphism of $\mathbb Z/9\mathbb Z$ that restricts to the identity on both copies of $\mathbb Z/3\mathbb Z$ and makes the diagram commute. But we can see that the induced map on the kernel will have to be $ x+3\mathbb Z$ to $2x +3\mathbb Z$ which is not the identity.
This argument generalizes and actually shows that by using the trivial extension and the maps $x+p\mathbb Z \mapsto ix+p^2\mathbb Z$ for $i=1,2,\dots, p-1$, the group $H^2(\mathbb Z/p\mathbb Z,\mathbb Z/p\mathbb Z)$ is at least of size $p$.
