Corollary 4.1.(i) in Johnstone's book Stone Spaces states that the category of realcompact spaces is dual to the full subcategory
of the category of commutative rings consisting of rings of the form C(X).
The functor C implements the duality.

The category of compact CW-complexes embeds into the category of realcompact
spaces as a full subcategory, hence the functor C is fully faithful.