Let $G$ be a $p$-group of class 2 and $\exp(\operatorname{Inn}(G))=p^c$. Then prove $\frac{G} {Z (G)}$ has the form $C_{ p^c}\times C_{ p^c}\times C$ for some (possibly trivial) abelian $p$-group $C$.
$C_n$ denotes the cyclic group of order $n$. Thank you
OK, here is a solution! Since $G$ has class 2, $G/Z(G)$ is abelian. Let me write $C(i)$ for a cyclic group of order $p^i$. Then $G/Z(G) \cong C(c) \times C(c_1) \times \cdots C(c_k)$ with all $c_i \le c$. We are asked to proved that there exists $c_i$ with $c_i=c$. So assume not. Then all $c_i < c$.
Let $x,y_1,y_2,\ldots,y_k$ be inverse images in $G$ of generators of the cyclic direct factors of $G/Z(G)$. I claim that $x^{p^{c-1}} \in Z(G)$, which is a contradiction, because $xZ(G)$ is assumed to have order $p^c$ in $G/Z(G)$. Clearly $[x,x^{p^{c-1}}]=1$. Since each $y_i^{p^{c-1}} \in Z(G)$, and the commutator map is bilinear in nilpotent groups of class 2, we have $[x^{p^{c-1}},y_i] = [x,y_i^{p^{c-1}}] = 1$ and hence $x^{p^{c-1}}$ centralizes all generators of $G/Z(G)$, so it lies in $Z(G)$ as claimed, giving a contradiction.