After @Thomas Andrews 's comment:
- We first show that $f$ is continous. Let $x_0\in [a,b]$. We will show that $f$ is continous at $x_0$. It is $|f(x)-f(x_0)|\leq |x-x_0|$ for all $x_0\not= x\in [a,b]$. So
$$-|x-x_0|\leq f(x)-f(x_0)\leq |x-x_0|\Rightarrow f(x_0)-|x-x_0|\leq f(x)\leq f(x_0)+|x-x_0|$$ and it is $\lim\limits_{x\to x_0}(f(x_0)-|x-x_0|)=\lim\limits_{x\to x_0}(f(x_0)+|x-x_0|)=f(x_0)$ so $\lim\limits_{x\to x_0}f(x)=f(x_0)$ $\checkmark$
- Let $g(x)=f(x)-x,\ x\in [a,b]$. Then $g$ is continous in $[a,b]$ since $f$ is. It is $g(a)=f(a)-a\ge0$ and $g(b)=f(b)-b\leq 0$.
If $g(a)=0 $ then $f(a)=a$ and since $|f(a)-f(x)|\leq |a-x|,\ \forall a\not= x\in [a,b]$ so $a$ is the unique element in $[a,b]$ s.t $f(c)=c$.
Similarly if $g(b)=0$.
If $g(a)g(b)\not=0$ then $g(a)g(b)<0$ so we can use Bolzano's theorem and we have $x_0\in [a,b]:\ f(x_0)=x_0$ and it is unique as we said before.