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 $A$ 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$. Post Undeleted by Mark Sapir 2 added 307 characters in body 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$A$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\$.