I am trying to prove the following:
Let $|G|=p^n$ for $n\geq 1$ and $p$ prime. Prove that $|\mathcal{Z} (G)|\neq p^{n-1}$.
Here is what I have so far:
Suppose, to the contrary, that $|\mathcal{Z} (G)|=p^{n-1}$. Then there is a $g\in G$ such that $g\notin \mathcal{Z} (G)$. Let $H=\left\{g^nz:n\in \mathbb{Z}, z\in \mathcal{Z} (G)\right\}$. We show that $H\leq G$ by showing that if $a,b \in H$, then $ab^{-1}\in H$.
If $a,b \in H$, then $a=g^nz_1$ and $b=g^mz_2$ for some $n,m \in \mathbb{Z}$ and $z_1, z_2 \in \mathcal{Z} (G)$. Then since elements of $\mathcal{Z} (G)$ commute with all elements of $G$, and $\mathcal{Z} (G) \leq G$, we have $$ab^{-1}=(g^nz_1)(z_2^{-1}g^{-m})=g^n(z_1z_2^{-1})g^{-m}=g^{n-m}(z_1z_2^{-1}).$$ The element $g^{n-m}(z_1z_2^{-1})\in H$, since $(n-m)\in \mathbb{Z}$ and $z_1z_2^{-1}\in \mathcal{Z} (G)$ (since $\mathcal{Z} (G) \leq G$). Hence, $H \leq G$. Furthermore, $H$ is abelian since $$ab=(g^nz_1)(g^mz_2)=g^n(z_1g^m)z_2=g^n(g^mz_1)z_2=(g^{n+m})(z_1z_2)=g^{m+n}(z_2z_1)=g^m(g^nz_2)z_1 =g^m(z_2g^n)z_1=(g^mz_2)(g^nz_1)=ba.$$ Also, $\mathcal{Z} (G) \leq H$, since if $|g|=k$ for some $k\in \mathbb{Z}$ (we know such a $k$ exists because $G$ is finite) then $g^kz=1z=z\in H$ for all $z\in \mathcal{Z} (G)$.
Okay, here is where I run into a problem. I want to come to a contradiction by arguing that the order of $H$ is greater than the order of $\mathcal{Z} (G)$ since for example, $gz \notin \mathcal{Z}(G)$ for any $z\in \mathcal{Z}(G)$. Someone told me I would come to the conclusion that $H=G$, but how?? I can't see why $|H|=|G|=p^n$, and even if I did, how does that give me a contradiction. I'm confused! Some help would be greatly appreciated. Thanks!