TITLE: the range of a function in $C_c(X)$ is compact
QUESTION [5 upvotes]: Consider the corollary of theorem 2.10 in Rudin's book R&C: the range of every $f\in C_c(X)$ is a compact subset of $\mathbb{C}$.
First, if $K$ is the support of $f$, then $f(X)\subset f(K)\cup\{0\}$. That's easy to understand. If $X$ isn't compact,then $0\in f(X)$, this really confuses me.
I want to explain that like this: if $0$ is not in $f(X)$, then $X$ may be considered as the support of $f$, but the support of $f$ is compact since $f\in C_c(X)$, hence it contradicts to the hypothesis of $X$, thus $0\in f(X)$.
Do anyone have a more preciser interpretation?

REPLY [7 votes]: Your interpretation is quite precise: if $0\notin f(X)$, then $\{x\in X,f(x)\neq 0\}=X$, and the support of $f$ is exactly the closure of the RHS, hence $X$.