I think this statement remains true for infinite groups, though I don't know if this was proved in the book you refer to. But to prove this version, you have to be more careful with the induction. You can use induction on the nipotency class of $H$ plus the nilpotency class of $K$ (considering the trivial group to have nilpotency class 0 and
an Abelian group to have nilpotency class $1$ (and, in general,
class($X$) = 1 + class($X/Z(X))$ by definition, where we consider a non-trivial group with trivial center to have infinite class). The base cases where this integer is $0$ or $1$ are easy. Also, it is clear that $HK \lhd G$ when $H \lhd G$ and $K \lhd G$. Furthermore, it is quite easy to see that $[H,K] = \langle h^{-1}k^{-1}hk : h \in H, k \in K\rangle \lhd G$, since the generating commutators for $[H,K]$ are permuted under conjugation by $G$ (for $g^{-1}(h^{-1}k^{-1}hk)g = (g^{-1}hg)^{-1}(g^{-1}kg)^{-1}(g^{-1}hg)(g^{-1}kg)$ and $H,K \lhd G$). Also, note that $[H,K] \subseteq H \cap K$, for we
have $h^{-1}k^{-1}hk = h^{-1}(k^{-1}hk) \in H$ as $H \lhd G$ and
$h^{-1}k^{-1}hk = (h^{-1}k^{-1}h)k \in K$ as $K \lhd G$.
We may suppose that $H$ and $K$ are both nontrivial, or there is nothing to do.
Now $Z(H) {\rm char} H \lhd G$ and $Z(K) {\rm char }K \lhd G.$ By induction,
$HK/Z(H)$ and $HK/Z(K)$ are both nilpotent (the sum of the nilpotence classes has dropped by at least one in each case). It follows that $HK/(Z(H) \cap Z(K))$ is nilpotent (the lower central series for $HK$ terminates in a group contained in $Z(H)$
because $HK/Z(H)$ is nilpotent, and terminates in a subgroup contained in $Z(K)$ since
$HK/Z(K)$ is nilpotent). But $Z(H) \cap Z(K) \leq Z(HK)$, so that $HK$ is nilpotent.
Let $G$ be nilpotent and nontrivial. Since every maximal subgroup of $G$ must be normal, and if $M$ is maximal then $G/M$ has no proper subgroups, it follows that if $M$ is maximal then $G/M$ is a group of order $p$, hence abelian. Therefore, $[G,G]\subseteq M$, since $[G,G]$ is contained in any normal subgroup $N$ of $G$ such that $G/N$ is abelian. In particular, $[G,G]\neq G$. Now simply note that being nilpotent is inherited to subgroups, as proven below, to conclude that $[H,H]\neq H$ for all subgroups $H$ of $G$ when $G$ is nilpotent. Hence, if every subgroup of $G$ is subnormal ($G$ is nilpotent), then the commutator subgroup of $H$ is properly contained in $H$ for any nontrivial subgroup $H$ of $G$ ($G$ is solvable).
(If $H\leq G$ and $K$ is a subgroup of $H$, then $K$ is subnormal in $G$, so there exist subgroups $K\triangleleft K_1\triangleleft K_2\triangleleft\cdots\triangleleft K_m=G$. Intersecting the subnormal series with $H$ gives you a subnormal series fo $K$ in $H$, showing $K$ is subnormal in $H$ as well; thus, every subgroup of $H$ is subnormal, so subgroup of nilpotent is nilpotent).
Added. I am tacitly assuming above that $G$ has maximal subgroups; so it might fail for infinite groups in which every subgroup is subnormal. In the infinite case, the usual definition of "nilpotent" is via either the upper central series or the lower central series, and that of "solvable" via the derived series. In the case of the definition via the lower central series, proving solvability is very easy: recall that the lower central series of $G$ is defined inductively by letting $G_1=G$ and $G_{n+1}=[G_n,G]$; and a group $G$ is nilpotent if and only if $G_{n+1}=\{1\}$ for some $n\geq 1$. Now note that $G^{(2)}=[G,G]=G_2$, and if $G^{(k)}\subseteq G_n$, then $G^{(k+1)} = [G^{(k)},G^{(k)}] \subseteq [G_k,G]=G_{k+1}$. So if the lower central series terminates, then so does the derived series, proving that if $G$ is nilpotent then $G$ is solvable.
Best Answer
The dihedral group $D_3$ is a split extension of the cyclic group $C_3$ by the cyclic group $C_2$. However, $D_3\cong S_3$ is not nilpotent since we have $Z(D_3)=1$ and a finite nilpotent group has a nontrivial center. So we have a counterexample, with $H=C_3$, $G=D_3$.