This paper is concerned with
the existence and structure of invariant means on the space C(S) of all (including
unbounded) continuous real-valued functions on a topological semigroup S. The main
result is that for realcompact semigroups every left invariant mean (if any
exist) arises as an integral over a compact left invariant subset of S. The
question of existence of noncompact group G such that C(G) admits a left
invariant mean is also considered. If G is a realcompact (or discrete, or locally
compact abelian) group, then C(G) admits a left invariant mean only if G is
compact.