Let ψ ∈ C(R) and X be a topological space. An identity preserving a bounded map h : C(X ) → R is called a ψ-homomorphism if h is additive and h • ψ = ψ • h. We call ψ a realcompact function if, whenever X is a realcompact space, any ψ-homomorphism h : C(X ) → R is an evaluation at some point of X . By classical results of Hewitt and Shirota, respectively, the square as well as the absolute value are examples of realcompact functions. This paper extends these results and gives a complete description of realcompact functions. Indeed, it turns out that ψ ∈ C(R) is a realcompact function if and only if ψ is non-affine. This leads to a Banach-Stone type theorem, namely, the realcompact spaces X and Y are homeomorphic if and only if C(X ) and C(Y ) are ψ-isomorphic for some non-affine function ψ ∈ C(R).