Let $ f$ be a function such that $|f(u)-f(v)|\leq|u-v|$ for all real $u$ and $v$ in an interval $[a,b]$.Then:
$(i)$Prove that $f$ is continuous at each point of $[a,b]$.
$(ii)$Assume that $f$ is integrable on $[a,b]$.Prove that,$|\int_{a}^{b}f(x)dx-(b-a)f(c)|\leq\frac{(b-a)^2}{2}$,where $a\leq c \leq b$
I tried to solve second part,First part i could not get idea.
$|\int_{a}^{b}f(x)dx-(b-a)f(c)|=|\int_{a}^{b}f(x)-f(c)dx|=\int_{a}^{b}|f(x)-f(c)|dx\leq\int_{a}^{b}|x-c|dx\leq\int_{a}^{c}(c-x)dx+\int_{c}^{b}(x-c)dx$
But i am not getting desired result,what have i done wrong in this?Or is there another method to prove it.Please help.