Dense subgroup in a profinite completion Let $G$ be finitely generated  residually finite group and $\hat{G}$ its profinite completion. Let $H \leq \hat{G}$ be a dense subgroup. Does it follow that $\hat{H}$ is isomorphic to $\hat{G}$?
 A: This is actually false. 
Theorem. Let $G$ be a finitely generated subgroup of $GL(n, {\mathbb R})$ which is not virtually solvable. Then $G$ contains a subgroup $H$ which is dense in $\hat{G}$ but $\hat{H}$ is not isomorphic to $\hat{G}$. 
Proof. According to a theorem of Margulis and Soifer, each finitely generated non-virtually solvable subgroup $G< GL(n, {\mathbb R})$ contains a maximal subgroup $H$, i.e. a subgroup such that if $H\le G_1\le G$, then either $G_1=H$ or $G_1=G$. 
G. Margulis, G. Soifer, Maximal subgroups of infinite index in finitely generated linear groups, Journal of Algebra, Volume 69, 1981, p. 1-23. 
Examination of their proof shows more, namely, that if $G$ is torsion free then there exists profinitely dense subgroup $H< G$ which is free of countably infinite rank. (They denote this subgroup by $S$, see pages 19 and 20 of their paper.) 
Remark. If you do not want to rely upon such examination, simply consider the following example: $G=F_2$, free group of rank 2. Then each maximal subgroup of $G$ will be free of infinite rank. Since $H$ is maximal, $H$ is dense in $\hat{G}$. 
Since $H$ is free of infinite rank, it admits an epimorphism to any finite group. But, since $G$ is finitely generated, it cannot have epimorphisms to arbitrary finite groups (for instance, if $G$ is $k$ generated, every quotient of $G$ is also $k$ generated, but the finite group $Z_2^{k+1}$ cannot be $k$ generated). Thus, $\hat{G}$ also does not admit epimorphisms to some finite groups. Therefore, $\hat{G}$ cannot be isomorphic to $\hat{H}$. qed   
Now, use the fact that all finitely generated subgroups of $GL(n, {\mathbb R})$ are residually finite. 
A: I believe this is correct. 
If $\hat{G}$ is finitely generated (as a topological group) and if $\hat{H}$ is another profinite group with the same isomorphism classes of finite groups as continuous finite images then $\hat{G}\cong\hat{H}$.
In the case above, it remains to show that $\hat{G}$ and the dense subgroup $H$ have the same finite images. This can be achieved using the second isomorphism theorem. 
A: Let me write down another class of groups where this fails.
By a result of Abert, the closure of a finitely generated weakly branch group (in the profinite topology of the relative automorphism group) contains a dense free subgroup. 
There are similar results by Epstein for Lie groups, but I don't know the exact reference. This is relevant, at least in spirit, to the answer by Moishe Cohen.
