If $G$ is a group such that $G/Z(G)$ has order $p^2$ for some prime $p$, show that $G/Z(G)\cong \mathbb{Z}_p\bigoplus \mathbb{Z}_p$ Does my proof work for this?

If $G$ is a group such that $G/Z(G)$ has order $p^2$ for some prime $p$, show that $G/Z(G)\cong \mathbb{Z}_p\bigoplus \mathbb{Z}_p$

Either $G/Z(G)\cong\mathbb{Z}_{p^2}$  or $G/Z(G)\cong \mathbb{Z}_p\bigoplus \mathbb{Z}_p$. Suppose that $G/Z(G)\cong\mathbb{Z}_{p^2}$. Then $G/Z(G)$ is cyclic and $G$ is Abelian. Also, $$G/Z(G)\cong Inn(G).$$ Let $$\phi:G/Z(G)\rightarrow Inn(G)$$ be an isomorphism and let $$bZ(G)\in G/Z(G).$$ Then $\exists g\in G$ such that $$\phi (bZ(G))(x)=gxg^{-1}$$ for all $x\in G$.
But since $G$ is Abelian, $$\phi (bZ(G))(x)=gxg^{-1}=(gg^{-1})x=ex=x,$$ so that $\phi (bZ(G))$ is the identity of $Inn(G)$, and since $\phi$ is an isomorphism, $bZ(G)$ is the identity of $G/Z(G)$. Since $bZ(G)$ is arbitrary, $G/Z(G)$ is the trivial group, which contradicts the fact that $|G/Z(G)|=p^2$. 
So $G/Z(G)\cong \mathbb{Z}_p\bigoplus \mathbb{Z}_p$.
QED

You did way more than you needed to. Once you say $G/Z(G)$ is cyclic implies $G$ is abelian, then you have $G=Z(G)$ so $|G/Z(G)|=1$ which is a contradiction. Hence you must have had $G/Z(G)\cong \mathbb{Z}_p\oplus\mathbb{Z}_p$ from the beginning.
