Showing group with $p^2$ elements is Abelian
Here is a way to show that the center of a group of order $p^2$ cannot be trivial without using the class equation. I think that the major drawback (and it is major) is that it is very specific for groups of order $p^2$. The class equation is much better because it is a much more general result
If $G$ has elements of order $p^2$, then the result follows because $G$ is cyclic. So suppose that all nontrivial elements of $G$ have order $p$.
Let $x\in G$ be of order $p$. Now, $\langle x\rangle$ is normal in $G$, since its index is the smallest prime that divides the order of $G$. Therefore, $yxy^{-1}\in\langle x\rangle$, so $yxy^{-1}=x^r$ for some $r$, $1\leq r \leq p-1$.
It is now easy to verify that $y^ixy^{-i} = x^{r^i}$. In particular, $y^{p-1}xy^{1-p} = x^{r^{p-1}}$. By Fermat's Little Theorem, $r^{p-1}\equiv 1 \pmod{p}$, so $y^{p-1}xy^{1-p} = x$. That is, $y^{p-1}$ centralizes $x$. But $y$ is of order $p$, so $y^{p-1}=y^{-1}$. Since $y^{-1}$ centralizes $x$, so does $y$. That is, $yx=xy$. Thus, the centralizer of $x$ contains at least $\langle x\rangle$ and $y$, hence is of order at least $p+1$. Since its order must divide $p^2$, the centralizer of $x$ is all of $G$, so $x$ is central.
Thus, $Z(G)$ is nontrivial.
Your first approach is good; The center of a $p$-group is non-trivial:
Proof: The center of any group is the union of the 1-element conjugacy classes in the group. For a $p-$group, the size of every conjugacy class is a power of p because the order of a conjugacy class must divide the order of the group. Then let $p^{n_i}$ be the order of the conjugacy classes, and the conjugacy class equation tells us that $|G| = p^n = |Z(G)| + \sum_i (p^{k_i})$, where $0 < k_i < n$ and thus $p$ must divide $|Z(G)|$ implying that the center is non-trivial. $\Box$
EDIT: Explaining class equation:
The conjugacy classes partition the group, so we know that $|G| = \sum|cl(a)|$. But as I said in the proof above, the union of the singleton conjugacy classes is $Z(G)$, so we can rewrite this equality as
$|G| = |Z(G)| + \sum|cl(a)|$
where we assume that each conjugacy class is represented only once (i.e we are not including the singletons in the second summand). However, since we know that the order of a conjugacy class divides the order of a group we can rewrite the second summand to be $\sum_i(p^{k_i})$ where $0 < k_i < n$ because clearly none of them can have the same order as $G$, and we finally get
$|G| = |Z(G)| + \sum_i(p^{k_i})$ where $0 < k_i < n$
Now to see that $p$ must divide $|Z(G)|$ we see that we can move the second summand to left and replace $|G|$ with $p^n$ to get $p^n - \sum_i(p^{k_i}) = |Z(G)|$ and clearly we can factor out $p$.
EDIT: Showing that the order of a conjugacy class must divide the order of a group:
To prove this, we will show that the size of a conjugacy class of a, $cl(a)$ is the index of the centralizer of $a$, $C(a)$.
Suppose $x$ and $y$ both make the same conjugate of $a$, or $xax^{-1} = yay^{-1}$. Then multiplying on the left by $y^{-1}$ and on the right by $x$ we can see that $y^{-1}xa = ay^{-1}x$ and hence, $y^{-1}x \in C(a)$. Thus we can also see that $x\in yC(a)$ and hence $xC(a) = yC(a)$.
Similarly, suppose $xC(a) = yC(a)$ then it follows that $x \in yC(a)$ and hence $x = yz$ for some $z\in C(a)$. Thus $xax^{-1} = (yz)a(yz)^{-1} = yzaz^{-1}y^{-1}$. But we know that $z\in C(a)$ so we can rewrite this as $yazz^{-1}y^{-1}$, or $yay^{-1}$. Thus $x$ and $y$ make the same conjugate of $a$.
Thus we have shown that the number of cosets of $C(a)$ equals the number of elements in $cl(a)$, or
$(G : C(a)) = |cl(a)|$
Since $C(a)$ is a subgroup of $G$, clearly $(G : C(a))$ divides $|G|$ and hence, $|cl(a)|$ divides $G$. $\Box$
So Deven's helpful comment shows why the center of any $p$-group is nontrivial, so look back at your first approach.
Hint: if $Z(G) = p$, consider an element $x \in G$ that is not in $Z(G)$.
What is the overlap between $Z(G)$ and the cyclic subgroup of $G$ generated by $p$?
What must the centralizer of $x$ be?
What does this imply about $Z(G)$?
Edit: This is an alternative to the path of showing that $G/Z(G)$ cyclic implies $G$ abelian; I consider this route to be also as illuminating and even elegant.