Prove that a continuous function has a fixed point Suppose that $a < b$ and $f: [a,b] \to\mathbb{R}$ is a continuous function such that the range of $f$ contains $[a,b]$. Prove that $f$ has a fixed point.
I've already proved the case of $[0,1]$ but I don't know how to do the general case. Help.
Proof for $[0,1]$:
Let $g(x)=f(x)-x$, then $g(0)=f(0)\geq 0$, and $g(1)=f(1)-1\leq 0$.
Otherwise, by using IVT, there must exist some $c$ in $[0,1]$ such that $g(c)=0$ meaning that $f(c)=c$.
 A: I'm not sure why you are stuck on [a,b].  The IVT applies to [a,b] just as it does to [0,1].
Let $x_1$ be such that $f(x_1) = a$ (as [a,b] is in range of f we know such $x_1$ exists.  Let $x_2$ be such that $f(x_2) = b$.
Let $g(x) = f(x) - x$.  $g(x_1) = a - x \le 0$ $g(x_2) = b - x \ge 0$.  (as $x_1$ and $x_2$ are between a and b).
So by IVT there is an x between $x_1$ and $x_2$ where g(x) = 0. And so f(x) = x.
A: By simply assuming that the range of $f$ contains $[a,b]$ pick $x_1,x_2$ such that $f(x_1)=\min_{[a,b]}f(x)$ and $f(x_2)=\max_{[a,b]}f(x)$ (which exist by Extreme Value Theorem). Since $f(x_1)\leq a$ and $f(x_2)\geq b$, apply your reasoning with $g(x)=f(x)-x$ on $[x_1,x_2]$ (or $[x_2,x_1]$) with the IVT.
A: If you have proved it for the case $[0,1]$ it should be fairly straight forward to use that for the general case by transformation. Consider $\phi(\theta) = f(a+(b-a)\theta)/(b-a)$ which will be a function from $[0,1]$ to $[0,1]$.
However your proof has issues, but the idea is right. The trick here is that you should use the fact that the function must take it's extreme values on the interval. That is you have $\xi_a$ and $\xi_b$ such that $f(\xi_a) = a$ and $f(\xi_b)=b$ and consider $f(x)-x$ on the interval $[\xi_a, \xi_b]$ (which should be understood as the closed interval between the end points regardless of which is larger). For example you have $f(\xi_a)-\xi_a = a - \xi_a \le a-a = 0$ with equality only if $\xi_a=a$ (which would mean that you have your fix point anyway). Similar reasoning applies to $\xi_b$. Then it's just a matter of applying the theorem of intermediate values.
