Can we ascertain that there exists an epimorphism $G\rightarrow H$?
Solution 1:
Let $G=Q_8\times D_8$, where $Q_8$ is the quaternion group and $D_8$ is the dihedral group of order $8$.
Let $f$ be an isomorphism $$f:G\times G =\left(Q_8\times D_8\right)\times \left(Q_8\times D_8\right)\longrightarrow \left(Q_8\times Q_8\right)\times \left(D_8\times D_8\right).$$ Now, let $\mu$ and $\lambda$ be epimorphisms $$\begin{eqnarray*}\mu:Q_8\times Q_8&\longrightarrow&Q_8 {\small \text{ Y }} Q_8\\ \lambda:D_8 \times D_8&\longrightarrow&D_8 {\small \text{ Y }}D_8\end{eqnarray*}$$ where $A {\small \text{ Y }} B$ denotes the central product of $A$ and $B$. Then $$\mu\times \lambda:\left(Q_8\times Q_8\right)\times \left(D_8\times D_8\right)\longrightarrow \left(Q_8 {\small \text{ Y }}Q_8\right)\times \left(D_8 {\small \text{ Y }}D_8 \right)$$ is an epimorphism. The key is that $D_8{\small \text{ Y }} D_8\cong Q_8{\small \text{ Y }} Q_8$, so if we take an isomorphism $$\phi:D_8{\small \text{ Y }} D_8\longrightarrow Q_8{\small \text{ Y }} Q_8,$$ then we can take $H=Q_8{\small \text{ Y }} Q_8$ and form an isomorphism $$1_H\times \phi:\left(Q_8 {\small \text{ Y }}Q_8\right)\times \left(D_8 {\small \text{ Y }}D_8 \right)\longrightarrow \left(Q_8 {\small \text{ Y }}Q_8\right)\times \left(Q_8 {\small \text{ Y }}Q_8 \right)=H\times H.$$ So, all in all, we have $$\newcommand{\ra}[1]{\kern-1.5ex\xrightarrow{\ \ #1\ \ }\phantom{}\kern-1.5ex} \newcommand{\ras}[1]{\kern-1.5ex\xrightarrow{\ \ \smash{#1}\ \ }\phantom{}\kern-1.5ex} \newcommand{\da}[1]{\bigg\downarrow\raise.5ex\rlap{\scriptstyle#1}} \begin{array}{c} \left(Q_8\times D_8\right) \times \left( Q_8 \times D_8 \right)& \ra{f} &\left(Q_8\times Q_8\right) \times \left( D_8 \times D_8 \right)&\\ & & \da{\mu\times \lambda} & & & & \\ & & \left(Q_8 {\small \text{ Y }}Q_8\right)\times \left(D_8 {\small \text{ Y }}D_8\right) & \ras{1_H\times \phi} & \left(Q_8 {\small \text{ Y }}Q_8\right)\times \left(Q_8 {\small \text{ Y }}Q_8\right) \end{array} $$ and thus an epimorphism $$f(\mu\times\lambda)(1_H\times \phi):G\times G\longrightarrow H\times H.$$ However, $Q_8{\small\text{ Y }}Q_8$ is not a homomorphic image of $Q_8\times D_8$. So this is a counterexample.
Appendix.
Credit and thanks to Peter Sin for his help with the crucial step in this answer.
See Prop. 3.13 of these notes ("The Theory of $p$-groups by David A. Craven", in case the link breaks again) for a proof that $Q_8 {\small \text{ Y }} Q_8\cong D_8 {\small \text{ Y }} D_8 \not\cong Q_8 {\small \text{ Y }} D_8$.