# Interval iff image is interval

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.

• If $f(x) = x$ has interval as it's image... – user81327 Jun 28 '13 at 0:28
$(\Rightarrow)$ Continuity preserves connectedness. Connected subsets of $\mathbb{R}$ are intervals.
$(\Leftarrow)$ The image $f(E)$ is an interval for every continuous $f$. In particular, $i(E) = E$ is an interval where $i$ is the inclusion.