Solution (source code)

= Solution

Let $\phi:G\to G$ be a continuous surjective endomorphism. For each $n$, inverse image under $\phi$ permutes the finite set of open subgroups of index at most $n$: surjectivity preserves the index, and injectivity of the inverse-image operation follows from surjectivity. Hence
$$
\phi^{-1}(G_n)=G_n.
$$
If $x\in\ker\phi$, then $x\in G_n$ for every $n$. Part 3(a)(iii) implies $\bigcap_nG_n=\{1\}$, so $x=1$. Thus $\phi$ is bijective. A continuous bijection from compact $G$ to Hausdorff $G$ is a homeomorphism, proving the <Hopf property of a topologically finitely generated profinite group>.