@Ester, this isn't the best answer, but it will be enough for you to get the idea: consider $X$ to be an infinite-dimensional topological vector space. It is known from a theorem of Weil that it cannot be locally-compact. Can we have functions with compact support defined on it, then? Let $f \neq 0$ be such a function and $x$ such that $f(x) \neq 0$. Then there exist a whole neighbourhood $U$ of $x$ such that $f(y) \neq 0 \forall y \in U$. Then $U \subset supp(f)$ and, since $supp(f)$ was supposed compact, $U$ will be relatively compact. Thus, $x$ has a relatively compact neighbourhood and, by translating it, all points will have some relatively compact neighbourhood, and thus $X$ is locally-compact, which is a contradiction. So, you cannot have functions of compact support on a non-locally-compact topological vector space.
On a non-linear space the proof is more involved, but the idea stays the same.
Of course, this makes sense if by $C_0(X)$ you understand the space of functions with compact support. If not, then you'd better specify its meaning in your original question.