I came across this problem stated in the title having no clue what to do, and got stuck even in the finite case. Here's my attempt:
I first proved that the group $G$, if it exists, cannot be finite abelian. If it were, we could factor $G$ into cyclic groups: $$G=C_{2^{e_1}}\times \cdots \times C_{2^{e_k}} \times C_{p_1^{s_1}} \times \cdots \times C_{p_m^{s_m}}$$ where all $p_i$'s are odd primes (not necessarily distinct), $k\ge 0, m\ge 0 $, and all $e_i$'s and $s_i$'s are positive integers. Since $\operatorname{Aut}(G_1) \times \cdots \times \operatorname{Aut}(G_n)$ is a subgroup of $\operatorname{Aut}(G_1 \times \cdots \times G_n)$, we have $$\left. \left(\prod _{i=1}^k2^{e_i-1}\cdot \prod_{i=1}^m p_i^{s_i-1}(p_i-1)\right) \right| \left|\operatorname{Aut}(G)\right|$$ Note that $2|(p_i-1)$ for all $i$, but $v_2(\left|\operatorname{Aut}(G)\right|)=v_2(10)=1$, so either $k=1, m=0$ or $k=0, m=1$. A simple argument shows that neither case satisfies the problem.
It's known that if $G$ is nonabelian, then $G/Z(G)\cong \operatorname{Inn}(G)$ cannot be cyclic. Assuming $G$ is finite, we get $\operatorname{Inn}(G)$ is a non-cyclic normal subgroup of $\operatorname{Aut}(G)\cong D_5$. But a non-cyclic normal subgroup of $D_5$ must be $D_5$ itself, so $\operatorname{Inn}(G)=\operatorname{Aut}(G)$, and every automorphism of $G$ is inner. Then I failed to construct an outer automorphism of $G$ to obtain a contradiction (thought an outer automorphism of $D_5$ would do the work).
I've searched groups of order less than $255$, and none of them has automorphism group $D_5$, so I believe the answer is no for finite groups. Could anyone please give a hint on how to proceed? Other approaches are also welcomed.
(Of course it is best to solve the general problem, without the finiteness hypothesis!)
For the case of infinite abelian groups see Thomas Fournelle
– kabenyuk Jul 08 '24 at 16:02