# If $f(0)=f(1)=1$ and $|f(a)-f(b)| < |a-b|$ then $|f(a)-f(b)| < \frac{1}{2}$

Problem: $f$ be a function on $[0,1]$ such that $f(0)=f(1)=1$ and $f(a)-f(b) < |a-b|$ for all $a$ not equal to $b$. Prove that $|f(a)-f(b)| < \frac{1}{2}$.

My attempt: Things I observed are that the slope of any chord joining any two points on the curve is between -1 and 1.

I also observe that the function is continous.

I tried to show that the if $f(x_1)$ and $f(x_2)$ are global max and min. respectively then $f(x_1)-f(x_2)<\frac{1}{2}$. I thought this would be easy to show and the correct approach as not only is it equivalent to the problem but we are also using the fact that global max and min exist. However i could not show this. I could only show $f(x_1)-f(x_2) < 1+x_1-x_2$ which is even weaker than what we are given.

This problem is from a mock test that i gave so in case the problem statement is wrong i apologise.

Assume without loss of generality that $a<b$.
If $b-a\le \frac12$, then the conclusion is immediate.
Otherwise $(a-0)+(1-b) = 1-(b-a) \le \frac12$, and you can then use the triangle inequality: $$|f(a)-1|+|f(b)-1| \ge |f(a)-f(b)|$$