A function $f:[a,b] \to [a,b]$ is said to have a fixed point $c \in [a,b]$ if $f(c)=c$. Show that every continuous function $f$ mapping $[a,b]$ onto itself has at least one fixed point.
I came up with a basic proof of this. I don't think it's quite correct, but let me know what you think.
Suppose $f:[a,b] \to [a,b]$ is continuous on $[a,b]$
Since the domain and codomain of $f$ are the same, $f(x)=x$
Let $\varepsilon>0, c \in[a,b]$
Let $\delta= \varepsilon$
Suppose $|x-c|<\delta$
$\Rightarrow |x-c|<\varepsilon$
$\Rightarrow |f(x)-f(c)|<\varepsilon$
Thus, $\lim_{x \to c} f(x)=f(c)$ and therefore $f(x)$ is continuous for all $c \in [a,b]$
Then $f(c)=c$ for all $c \in [a,b]$
Thus, every continuous $f$ mapping $[a,b]$ onto itself has at least one fixed point