TITLE: Countable subgroups of compact groups
QUESTION [14 upvotes]: What is known about countable subgroups of compact groups? More precisely, what countable groups can be embedded into compact groups (I mean just an injective homomorphism, I don't consider any topology on the countable group)? In particular, can one embed S_\infty^{fin} (the group of permutations with finite support) into a compact group? Any simple examples of a countable group that can't be embedded into a compact group?

REPLY [20 votes]: As a complement to Reid's answer: a finitely generated group is maximally almost periodic if and only if it is residually finite. Indeed, if a group is residually finite, it embeds into its profinite completion, which is compact. Conversely, if a finitely generated group $G$ embeds into a compact group $K$, then using first that homomorphisms $K\rightarrow U(n)$ separate points of $K$, second that finitely generated linear groups are residually finite (Mal'cev theorem), we conclude that $G$ is residually finite.