# Proof that if f is function, continuous on an interval I then f(I) is also an interval

The theorem would be:

Let $f:E\to\mathbb{R}$ a continuous function and $I$ and interval, $I \subseteq E$. Then $f(I)$ is also an interval.

I'm not sure if I've understood completely what I have to prove. So, I need to prove that f takes all the values in $f(I)$, which is easy, using the intermediate value theorem.

But how do I know that $\forall x \in f(I)$, then $f(x) \in I$ ? Isn't it necesary to also prove this? I know for sure that $\forall \lambda \in f(I)$ , there is an $x_{\lambda}$ such that $f(x_{\lambda})=\lambda$, given the fact that $I=[a,b]$ , and $f(I)=[f(a),f(b)]$. That is, forbsure, every value in $f(I)$ is taken by f. So, what I don't know how to prove is how do I know that for any value in $I$ , the function sends me for sure in $f(I)$??

• It is not true that if $I=[a,b]$, then $f(I)=[f(a),f(b)]$. Consider for example $f(x)=x^2$ and $I=[-1,1]$. – Servaes Jun 1 '14 at 15:23
• Noe that in general $f([a,b])\ne [f(a),f(b)]$. – Hagen von Eitzen Jun 1 '14 at 15:23
• Indeed, you guys are right – Bardo Jun 1 '14 at 15:36
• This follows for the extreme value theorem and intermediate value theorem. – Gamma Function Jun 1 '14 at 16:04
• Note that this requires singleton sets such as $\{ a \}$ (or $[a,a]$) to be considered intervals. Some definitions of "interval" exclude them. – Jeppe Stig Nielsen Jun 1 '14 at 22:54

## 2 Answers

The comments already answer the questions raised in your last paragraph so I'm not sure my answer adds much. But I can always delete it later. As for proving that $f(I)$ is an interval if $I$ is, here is how I would do it:

First I'd prove that in $\mathbb R$ a set is connected if and only if it is an interval. But this was probably done in the book you are reading or the lecture you are taking.

Next I'd prove that a continuous function maps connected sets to connected sets: By contradiction assume that not. Then there are open disjoint sets $U,V$ such that $f(I) = U \cup V$. Then $I = f^{-1}U \cup f^{-1}V$ is disjoint, a contradiction.

Note that this is exactly what you are asked to show when the statement is restricted to $\mathbb R$. So perhaps what I wrote earlier is not true and this exercise is exactly asking you to prove that a set in $\mathbb R$ is connected if and only it is an interval. Since if you assumed both that and the intermediate value theorem there is nothing left to prove.

• Well, here's the answer my textbook gives, and I'm quoting word by word: We need to show that if $\alpha,\beta in f(I)$ then it exsits $a,b\in I$ such that $f(a)=\alpha, f(b)=\beta, a \neq b$. But f is continuous and $\lambda$ is an intermediate value, then there is $x_{\lambda} \in (a,b)$ such that $f(x_{\lambda})=\lambda$, that is $\lambda \in f(I)$ . But I am not conviced at all – Bardo Jun 1 '14 at 15:37
• Honestly, in my opinion this doesn't prove the theorem at all, and it's just some words that don't make sense, but probably I'm wrong. – Bardo Jun 1 '14 at 15:44
• @Bardo No, I agree with you, as stated it doesn't make much sense. But it's clear to me what it's trying to do: it wants to show that $f(I)$ is an interval by applying the intermediate value theorem. It completely fails to mention what lambda is and that is must be between $\alpha$ and $\beta$. On top of that, the English is broken. Maybe it would be helpful to you if (in addition) you could get yourself a better book from the library. – Rudy the Reindeer Jun 1 '14 at 16:02
• Wait, I found a proof!! – Bardo Jun 1 '14 at 16:11
• I posted itt. I actually asked uou to do thaf, but in a comment of mine at the answer od @Gamma. Thank you! – Bardo Jun 1 '14 at 16:35

It seems that the biggest problem I had proving this, is that I didn't know how to rigurously define an interval. So, let me first state the rigurous definition of an interval, for those who may end up here, and who don't already know it, but they are also asking themselves how to prove the theorem in my question.

We say that the set $I$ is an interval if for any $a,b\in I$, with $a<b$ we have that if $a\leq c\leq b$, for a number $c$ , then also $c\in I$.

Now, if $\alpha,\beta \in f(I)$ , there is $a,b\in I$, such that $f(a)=\alpha$ and $f(b) = \beta$. Let $\lambda$ , with $f(\alpha) \leq \lambda \leq f(\beta)$ . We want to show that $\lambda \in f(I)$. If $\lambda=f(\alpha)=f(\beta)$, then obsiously $\lambda \in f(I)$, so we now have to deal only with the case when the inequality is strict: $f(\alpha) < \lambda < f(\beta)$

But we know from the intermediate value theorem that that there is an $x_{\lambda}\in (a,b)$ such that $f(x_{\lambda})=\lambda$, that is $\lambda \in f(I)$, because obsiously $f(x_{\lambda})\in f(I)$. Q.E.D.

Is this correct? I haven't been able to find any flaw in my proof.

• Just a minor thing: If you have $f(\alpha)<\lambda< f(\beta)$ you can't have $\lambda=f(\alpha)=f(\beta)$. You'd have to slightly rephrase this. And I'd change $x_\lambda \in I$ into $x_\lambda \in (a,b)$ just to be more precise. But it's not necessary. Otherwise this looks good to me! – Rudy the Reindeer Jun 1 '14 at 16:41
• I modified the proof, rephrasing that part. Thank you for your observation. I love the elegance of mathematical analysis. This is the first year I study it. In my classroom, we don't bother with proofs of such theorems, just with how we vcan apply it in problems. The teacher always gives us the proof, but it underlines every time that we don't need to know it. The reason is because I'm in highschool, and we don't actually need to do formal proofs like this in our exams, just to solve limits, and other problems. – Bardo Jun 1 '14 at 17:30
• But I like this branch of math so much, that I decided to retake all the manual by myself and prove everything (or almost everything) in there, to get a better understanding of the subject. – Bardo Jun 1 '14 at 17:31