Show that a nonempty set $E$ of real numbers is an interval if and only if every continuous real-valued function on $E$ has an interval as its image.
Suppose $E$ is an interval. For any $a,b\in E$ with $a<b$, we have that any $c\in(a,b)$ belongs to $E$. Let $f$ be a continuous real-valued function on $E$. Take two elements $f(a)$ and $f(b)$ in its image, and let $x\in(f(a),f(b))$. By the intermediate value theorem, there exists $c\in E$ such that $f(c)=x$. So the image is an interval.
What about the converse?