We are interested in commutative rings $(R,+,\cdot)$ such that:
(a) All subgroups are ideals;
(b) All subgroups are subrings;
(c) All subrings are ideals.
For example $(\mathbb{Z},+,\cdot)$ and $((\mathbb{Z}_n,+,\cdot)$ enjoy all the properties. Now,
(1) Are these true for all PID's?, what about UFD's?
(2) Can somebody state some classes of such rings?
$\mathbb Q[x]$ is a counterexample for all three points. $\mathbb Q$ is a subgroup and subring that isn't an ideal. And also $\mathbb Q+x\mathbb Q$ is a subgroup, but it isn't a subring. Since none of these are true for all PIDs, then none of these are true for all UFDs.
As mentioned in the comments already, $\mathbb Z$ and its quotients are the only rings with identity in which all subgroups/subrings are ideals. I am not sure what conditions would make subgroups subrings.