When is the profinite completion a pro-$p$ group? My research area is mainly pro-$p$ groups and profinite groups. However, in the last few year I became also interested in discrete groups. Therefore, it seems to me a natural problem to look for examples of finitely generated groups such that their profinite completion is a pro-$p$ group. One trivial example is when the profinite completion is trivial or a finite $p$-group, e.g. an infinite simple group. Hence, it makes sense to require the group to be infinite and residually finite. But then you can take residually finite, $p$-groups, e.g., the Grigorchuk group. In such case tha profinite completion is pro-$p$ for an easy reason. 
So here are my questions:


*

*Is there an infinite finitely generated residually finite non-torsion group such that its profinite completion is pro-$p$?

*Is there an infinite finitely generated residually finite torsion free group such that its profinite completion is pro-$p$?
(Notice that profinite completion being pro-$p$ means that all subgroups of finite index are of $p$-power index.)      
 A: I have a suggested approach to problem 1. The idea is to try to construct a group with a presentation satisfying the Golod-Shafarevich inequality, but which still retains elements of infinite order.
Take  $F=\mathbb{Z}/p\ast \mathbb{Z}/p$, and enumerate the homomorphisms of $F$ to finite non-cyclic simple groups $\varphi_i: F\to H_i$. We'll fix an element $f\in F$ of infinite order. Inductively construct quotient groups $F\to F_i$ such that $F_i$ does not factor through any of the first $i$ homomorphisms to finite simple groups, while requiring that $F_i$ is hyperbolic and Golod-Shafarevich with only $p$-torsion and the image of $f$ in $F_i$ is infinite order. Suppose $\varphi_{i+1}: F \to H_{i+1}$ factors through $F \to F_i \to H_i$ (if not, let $F_{i+1}=F_i$, and repeat the induction). Choose an element $g_i \in F_i$ such that $g_i$ is infinite order and $g_i$ has non-trivial image in $H_i$ of order prime to $p$. Moreover, assume that the normalizers of $g_i$ and $f$ in $F_i$ are mutually malnormal, so have trivial intersection of all conjugates (I think these conditions are not difficult to arrange via the techniques of hyperbolic groups). Then kill a high-enough $p$-power of $g_i$ to get a quotient hyperbolic group $F_{i+1}$ which does not factor through $\varphi_{i+1}$, and $F_{i+1}$ satisfies the Golod-Shafarevich presentation condition, and remains hyperbolic with $f$ of infinite order (I claim that it is possible to arrange these conditions). Now, take the infinitely presented quotient $F_\infty$ by adding all the relators defining $F_i$. This will be a Golod-Shafarevich group, and $f$ will have infinite order in the image. Clearly $F_\infty$ can only have finite $p$-quotients, since we have killed all of the finite simple non-cyclic quotients. 
The issue is though whether $F_\infty$ is residually finite. One may take its maximal residually finite quotient, which is non-trivial due to the Golod-Shafarevich property. But the question is how does one show that this quotient is non-torsion? It's not clear that $f$ has infinite order in the profinite completion, which would suffice. Maybe by choosing the sequence $g_i$ more carefully, one may guarantee this property. 
A: Gustavo A. Fernández-Alcober, Alejandra Garrido and Jone Uria-Albizuri gave a positive answer to question 2 and therefore also to question 1 in On the congruence subgroup property for GGS-groups. 
