# Profinite Group, Compact Hausdorff Totally disconnected topological group

If G is a compact Hausdorff totally disconnected topological group, and I want to show that G is profinite, I am interested in surjectivity for now. Let $\hat{G}$ be the profinite completion of $G$, and $\rho : G \to \hat{G}$ the usual continuous group homomorphism. we know that $\rho(G)$ is dense in $\hat{G}$, and is compact in $\hat{G}$ since $G$ is. $\rho(G)$ is hence also closed in $\hat{G}$, so $\rho$ is surjective. Is this reasonnable?

I don't know why you know that $\rho(G)$ is dense in $\hat G$, but yes, if $\rho$ has closed and dense image, it is surjective for sure!