Determining the conjugacy classes of a non-abelian group $G$ of order $8$

Let $G$ be a non-abelian group of order $8$. It is easy to see, that G has center $Z(G)\cong\mathbb{Z}/2\mathbb{Z}$. Set $Z(G)=\{e,z\}$. Is is also easy to see that $G/Z(G)\cong V$ is the Klein four group. Hence set $$G/Z(G)=\{Z(G), aZ(G), bZ(G), abZ(G)\}.$$ As $G/Z(G)$ is abelian, each of its element is the only element in its conjugacy class. I want to find the conjugacy classes of $G$. I suppose that they are $$\{\{1\},\{z\}, \{a,az\},\{b,bz\},\{ab,abz\}\}.$$

How can I find in this specific example (assuming that I don't know from the classification the precise structure of the two possible groups $G$) the conjugacy classes of $G$, if I already know the conjugacy classes of $G/Z(G)$?
Can I perform this strategy for a general $G$, if I already know the conjugacy classes of some factor group $G/N$?

From an answer to this question, I already know that the preimage under $G\to G/Z(G)$ of a conjugacy class in $G/Z(G)$ is a union of conjugacy classes of $G$ but how do I know which of the preimages 'decompose' into conjugacy classes and which preimages don't?

Hint If $y$ is in the center $Z(G)$ of a group, then for all $g \in G$ we have $$g y g^{-1} = g g^{-1} y = y,$$ and so the conjugacy class of $y$ is just the singleton $\{y\}$. How can we modify this observation to say something about the case $y \not\in Z(G)$?
Additional hint Conversely, if $y \not \in Z(G)$, there some $g \in G$ such that $g y \neq y g$, and hence such that $g y g^{-1} \neq y$, and in particular the conjugacy class of $y$ is not a singleton.
(This linear of reasoning is sufficient, by the way, to handle the case $|G| = 8$, but not the general case.)
• Thank you, this is really easy. I already made this observation when guessing the conjugacy classes of $G$ as above, but somehow I did not realize that it suffices :). Unfortunately this strategy does not work for classes with $\geq 3$ elements. If I understand you correctly, this is in general difficult, is it? – user8463524 Dec 5 '15 at 8:36
• It's easy in the sense that there's a naive algorithm of complexity $O(|G|^2)$ to identify the conjugacy classes (and probably one can improve on this some), but perhaps it suffices to say that this sort of observation is generally not enough to determine the conjugacy classes a priori. – Travis Willse Dec 5 '15 at 21:25