Profinite completion of a semidirect product If we have two finitely generated residually finite groups $G$ and $H$, is there are relation between
the profinite completions $\hat{G},\hat{H}$ and the profinite completion of a semidirect 
product $\hat{G \rtimes H}$
(and analogous question for pro-p completions)
 A: I convinced myself the Mark's second claim is true. Here is a detailed argument. Let us start by checking whether $\widehat{G} \rtimes \widehat{H}$ actually exists. We assume that both $G$ and $H$ are is finitely generated. Let $\varphi:H \to \textrm{Aut}(G)$ be the map that defines the semidirect product. 
First we need to check that $\varphi$ can be extended to $\textrm{Aut}(\widehat{G})$. As $G$ is finitely generated it has finetely many subgroups of index $n$, let $G_n$ be their interestion. Then $G_n$ is a characteristic subgroup of finite index in $G$. Moreover, every subgroup of finite index in $G$ contains one of the $G_n$'s. Thus, $\widehat{G}$ is the inverse limit of $G/G_n$. Now every autmorphism of $G$ preserves $G_n$, hence, $\textrm{Aut}(G)$ is embedded in $\textrm{Aut}(\widehat{G})$. We conclude that $\varphi$ can be extended to $\textrm{Aut}(\widehat{G})$.
We now need to recall the topology on $\textrm{Aut}(\widehat{G})$. The open neighborhoods of the identity are defined as $A(G_n)$ the kernel of the map from $\textrm{Aut}(\widehat{G})$ to $\textrm{Aut}(G/G_n)$. To extend $\varphi$ to $\widehat{H}$ we need $\varphi$ to be continuous on the profinite topology of $H$. Thus, we need that $H_n$
the kernel of the map from $H$ to $\textrm{Aut}(G/G_n)$ to be of finite index.
If $H$ is finitely generated, tThis is indeed the case as $\textrm{Aut}(G/G_n)$ is a finite group. So $\varphi$ can be extended. 
That means we can define $\widehat{G} \rtimes \widehat{H}$. Moreover, from the above argument $\varphi$ is continuous on $\widehat{H}$, so $\widehat{G} \rtimes \widehat{H}$ is a profinite group. We notice that $\widehat{G} \rtimes \widehat{H}$ is the inverse limit of $(G \rtimes H)/(G_n \rtimes N)$, where $n \in \mathbb{N}$ and $N$ is a normal subgroups of finite index in $H$.
We always have a map from the profinite completeion of a group onto any profinite completion with respect to some subgroups of finite index. So we get $\psi$ from $\widehat{G \rtimes H}$ onto $\widehat{G} \rtimes \widehat{H}$.  Now, suppose $K$ is a subgroup of finite index in $G \rtimes H$. Let us look at $K \cap G$, it is a subgroup of finite index in $G$. Therefore, it contains some $G_n$. Also, $K \cap H$ is of finite index in $H$. Now, $G_n \rtimes (K \cap H)$ is a subgroup, it is of finite index in $G \rtimes H$, and it is contained in $K$. We deduce that that $\psi$ is an isomorphism. 
Edit: I do not think it is necessary for $H$ to be finitely generated so I fixed the argument.
A: Let $\mathscr{P}$ be any property
such that whenever a group has $\mathscr{P}$ then all its subgroups also have $\mathscr{P}$.
In [1] Theorem 3.1, K. W. Gruenberg has proved that if the wreath product
$W= A \wr B$, is residually $\mathscr{P}$,
then either $B$ is $\mathscr{P}$ or $A$ is abelian. 
Consider $W= S_3 \wr \mathbb{Z}$, where $S_3$ is the symmetric group of
degree 3. 
Since $S_3$ is not abelian, $\mathbb{Z}$ is not finite, and the subgroup of any finite group is finite, 
the group $W$ is not RF.
Clearly, $W= \prod_{i \in \mathbb{Z}} S_3 \rtimes \mathbb{Z}$, where $\mathbb{Z}$ and $\prod_{i \in \mathbb{Z}} S_3$
are residually finite.
[1] K. W. Gruenberg, Residual properties of infinite soluble groups}, 
Prec. London Math. Soc., Ser. 3, 7 (1957), 29--62.
A: Take a finite non-abelian simple group $A$ and consider the wreath product $G=A\wr \mathbb Z$. Let $N$ be any subgroup of finite index of $G$. Then $N\cap A^{\mathbb Z}\ne 1$. Let $g$ be a non-trivial element in the intersection. Suppose that the $i$-th coordinate $g_i$ of $g$ is not $1$. Since $A$ has trivial center, there exists $h\in A$ such that $[g_i,h]\ne 1$. Let $h'$ be the element of $A^{\mathbb Z}$ with $h$ on the $i$-th coordinate and trivial other coordinates. Then $[g,h']$ is in $N$ and has exactly one non-trivial coordinate (number $i$). Using the fact that $A$ is simple and the action of ${\mathbb Z}$ on $A^{\mathbb Z}$, we get that $N$ contains $A^{\mathbb Z}$. Hence the profinite (pro-p) completion of $G$ is the same as the profinite completion of $\mathbb Z$. Of course $G$ is a semidirect product of $A^{\mathbb Z}$ and $\mathbb Z$, both residually finite. 
If $G, H$ are finitely generated, then $P=\hat G\rtimes \hat H=\hat{G\rtimes H}$. Indeed it is easy to see that the profinite completion of $G$ in $P$ is $\hat G$. That is because for every finite index subgroup $N$ of $G$ there exists a finite index subgroup $K$ in $G\rtimes H$ such that $K\cap G < N$. 
