My textbook stated the following corollary from the Weierstrass Intermediate Value Theorem:
Let $f$ be a continuous mapping of $[0,1]$ into $[0,1]$. Then $\exists z \in [0,1]: f(z)=z$
And the proof they gave for this is quite simple:
If $f(0)=0 \vee f(1)=1$ then this is obviously true so let's see the case where $f(0) > 0$ and $f(1) < 1$.
Let's define $g:[0,1]\to \Bbb R$ such that $g(x)= x - f(x)$. Then $g$ is continuous. We have that $g(0) = - f(0) < 0$ and $g(1) = 1- f(1) > 0$ so $\exists z \in [0,1]: g(z)= 0$ which is the same as saying $z - f(z) = 0 \iff f(z) = 0$.
So, now they ask me to prove that:
If $f$ is a continuous function from $[a,b]$ to itself then there is a fixed point.
I think they want the reader (me in this case) to prove this by adapting the proof that they gave for the case where $[a,b] = [0,1]$ but I was not capable of doing so. What I did was:
We know that $[0,1] \cong [a,b]$, so let $g:[0,1] \to [a,b]$ be an homeomorphism.
Let's define a function $f':[0,1] \to [0,1]$ as $f' = \left(g^{-1} \circ f \circ g\right)(x)$. Because each function is continuous then the composition of functions is also continuous. By the corollary $\exists z \in [0,1]: f'(z) = z$. This means:
$$\left(g^{-1} \circ f \circ g\right)(z) = z$$
as $g$ is bijective we can apply $g$ to both sides and get:
$$f(g(z)) = g(z)$$
So there exists a fixed point for the function $f$.
Now, first of all, is my proof correct or am I missing some detail?
Second: How can I prove this by adapting the proof they gave for the corollary?
Your proof is fine, and in fact shows someting more general: the FPP is a topological property. (FPP= fixed point property, every $f: X \to X$ that is continuous has a fixed point)
The proof from the text is easily adaptable (but it gets a bit messy). But it's better IMHO to do it the way you did, and note that this fact doesn't hinge on $[0,1]$ per se but on the "topological type" of $[0,1]$.