By the definition of a subring, an ideal of $C(\mathbb{R})$ would be a subset $I$ of $C(\mathbb{R})$ such that:
- For $f_1,f_2 \in I$, $f_1 + f_2 \in I$
- For any $f \in I$ and any $g \in C(\mathbb{R})$, $f\cdot g \in I$.
With that in mind, the set of continuous functions with compact support is the only set you've described satisfying all of these properties.
Why the other sets fail to be ideals:
The set $C^\infty(\mathbb{R})$:
Note that $f = 1$ given by $f(x) = 1$ is in $C^\infty(\mathbb{R})$ and $g$ given by $g(x) = |x|\in C(\mathbb{R})$, but $f\cdot g = g \not \in C^\infty(\mathbb{R})$. Incidentally, this is why no proper subset of a ring containing the multiplicative identity can be an ideal of that ring.
The set of functions with compact support:
Not all such functions are continuous, and so this fails to be a subset of $C(\mathbb{R})$ (I'll leave it to you to find a counterexample). Thus, it is not an ideal thereof.
The set $C_0(\mathbb{R})$ of continuous functions vanishing at $\pm \infty$
Note that $f$ given by $f(x) = e^{-|x|}$ is in $C_0(\mathbb{R})$, and $g$ given by $g(x) = e^{|x|}$ is continuous. However, $f \cdot g = 1$ is not in $C_0(\mathbb{R})$.