# Intermediate value theorem and non-closed and closed intervals

As many know, the intermediate value theorem states that given a function $f$ that is continuous on a closed interval $[a, b]$ with M a number between $f(a)$ and $f(b)$. Then there exists a number $c$ such that,

1. $a<c<b$
2. $f(c)=M$

However I encountered contained a non-closed interval, an open one, it says: given $f$ and $g$ continuous functions on $[a,b]$ ($a<b$ of course) such that $g([a,b])=[a,b]$ (closed interval)) and $f([a,b])\subseteq]a,b[$, then show that there is at least one $c$ in $]a,b[$ (open interval) with $f(c)=g(c)$.

My problem is that I have no idea on how to apply the IVT in this case, can anyone give a hint please?

Edit All we need to show now, thanks to @TZakrevskiy, is that $$]x_1,x_2[\subseteq]a,b[$$ which is that which where i struggle Any hints?

Take $x_1$ such that $g(x_1)=a$ and $x_2$ such that $g(x_2)=b$. Suppose for simplicity that $x_1<x_2$. What can you say about the difference $f-g$ on the interval $[x_1,x_2]$?
• of course $g$ is continuous on $[x_1,x_2]$, i'll have to show that $f$ is defined on that interval, secondly, $f-g$ is continuous since both of them are continuous on that interval, hence if $0$ is in $[x_1,x_2]$ then there is at least some $c$ in (in which interval?) such that $f(c)-g(c)=0$, which would prove what is needed, however one would need to show that $x_1$ is less than $0$ and $x_2$ is greater so that $0\in$ that interval.................. – Bounded Turtle Oct 13 '15 at 21:01
• You don't need that $0\in ]x_1,x_2[$. Take a closer look on the formulation of IVT. – TZakrevskiy Oct 13 '15 at 21:03
• Not the image of the whole interval. What can you say about hte sign $f(x_i)-g(x_i)$ for $i=1,\,2$? – TZakrevskiy Oct 13 '15 at 21:06
• In fact, you can't, I made a typo. What you can show is that $[x_1,x_2]\subset [a,b]$. To do so, it is sufficient to prove that $x_i\in [a,b]$, and they are there by our hypothesis on possible values of $g$ – TZakrevskiy Oct 13 '15 at 21:21
• No, we would need that $c \in]x_1,x_2[$. The IVT gives you $c\in[x_1,x_2]$ such that $f(c)=g(c)$, but the points $x_i$ are already ruled out, because, as you showed, $f(x_i)-g(x_i)\ne 0$. – TZakrevskiy Oct 13 '15 at 21:31