Show unique fixed point using continuity Let $f : [a,b] \rightarrow [a,b]$ be a real-valued function such that,
$$
|f(x) - f(y)| < |x-y|, \forall x,y \in [a,b], x \neq y.
$$
I need to show that $f$ has a fixed point.
My attempt:
I defined $g(x) = |f(x) - x|$ over $[a,b]$
showed that it is continuous, how can I use it to show that $f$ has unique fixed point. Any hints will be appreciated... 
 A: You don't actually need that it is shrinking for there to exist a fixed point, only continuity. Take $g(x)=f(x)-x$ (note that I don't take the abs. value, this is important, but you where on the right track.). Then $g(a)\geq 0$, and if there is equality then you have your fixed point, so assume $g(a)>0$. Similarly we may take $g(b)<0$, so since the continuous image of a connected set is connected, there must exist some $x_0\in [a,b]$ such that $f(x_0)=x_0$.
Now we use that $f$ is shrinking to show that this fixed point is unique. Suppose another point $y_0$ was a fixed point of $f$. Then $$|x_0-y_0|=|f(x_0)-f(y_0)|<|x_0-y_0|$$ a clear contradiction.
A: If you let $y$ tend to $x$, that is you take $y=x+h$, and take $\text{lim (} h\rightarrow 0)$ in the given inequality, then you can show that the function $f(x)$ is continuous.
This fact is enough to show the existence of a fixed point.
Define the function $g(x)=f(x)-x$, $g:[a,b]\rightarrow[a,b]$.
Check that $f(a)\ge a, f(b) \le b$ according to the codomain of the function $f$. 
If $f(a)=a$, then we are done because $a$ is a fixed point, else assume $f(a)>a$.
If $f(b)=b$, then we are done because $b$ is a fixed point, else assume $f(b)<b$.
Now see that $f(a)>a,f(b)<b \Rightarrow g(a)>0, g(b)<0$, and $g(x)$ being the difference of two continuous functions over $[a,b]$, $f(x)$ and $x$, $g$ is itself is continuous. So $g$ must follow the Intermediate Value Property, so that $g(a)>0,g(b)<0$ ensures the existence of some $c \in [a,b]$ such that $g(c)=0 \Rightarrow f(c)=c$, so that $c$ is our fixed point. 
If there are more than two fixed points, let them be $c,d \in [a,b]$, and $c \ne d$.
According to the assumption, $f(c)-c=f(d)-d=0\Rightarrow f(c)-f(d)=c-d \Rightarrow \mid f(c)-f(d) \mid = \mid c-d \mid$ which violates the given condition.
