Marginality does not satisfy intermediate subgroup condition

Statement
It is possible to have a group $$G$$ and subgroups $$H,K$$ of $$G$$ such that $$H \le K$$ and:


 * $$H$$ is a marginal subgroup of $$G$$.
 * $$H$$ is not a marginal subgroup of $$K$$.

Proof
Consider the following:


 * $$G$$ is dihedral group:D8.
 * $$H$$ is the center of dihedral group:D8.
 * $$K$$ is one of the Klein four-subgroups of dihedral group:D8.

Then, we have:


 * $$H$$ is marginal in $$G$$, because center is marginal (it is marginal with respect to the variety of abelian groups).
 * $$H$$ is not marginal in $$K$$, because it is not characteristic in $$K$$.