Let $G$ be a sofic group (see this survey article of Pestov for the definition and various results) - all amenable groups are sofic, as are all free groups, and no groups are known to be non-sofic. Let $X=\{0,1\}^G$ with the product topology and let $f: X \to X$ be a continuous function which is also a right $G$-map, here $G$ acts on $X$ by shifts. Then if $f$ is injective, it is automatically surjective - this is Gromov's partial solution to the Gottschalk surjunctivity conjecture, which I think is also mentioned in Pestov's article.
Now this is not what your question asked for, but if we now look at $C(X)$ and the induced algebra homomorphism $f^* : C(X) \to C(X)$, then
$f^*$ surjective $\iff$ $f$ is injective (Tietze/Urysohn) $\iff$ $f$ is bijective (above) $\iff$ $f^*$ bijective (Tietze/Urysohn)