If $g \circ f=g$, prove that $g$ is constant Let $f:\mathbb{R} \to [0,1]$ be a monotonic function so that $|f(x) - f(y) | <|x-y|$, $\forall x, y \in \mathbb{R} $, $x\neq y$. If $g:\mathbb{R} \to \mathbb{R} $ is a continuous function and $g \circ f=g$, prove that $g$ is constant.
This problem also previously asked to prove that $f$ has a unique fixed point and I could show this by proving that $f$ is continuous and considering the function $h(x) =f(x) - x$. Yet, I don't know how to use this to prove that $g$ is constant. 

Denote by $c$ the fixed point of $f$.
Let $a \in \mathbb R$ be arbitrary. Then 
$$g(a)=g(f(a))=g(f^2(a))=....=g(f^n(a))=...$$
The sequence $x_n =f^n(a)$ converges to the fixed point $c$ of $f$. Therefore by continuity of $g$
$$g(a)=g(x_n) \to g(c)$$ 
This shows that $g(a)=g(c)$ for all $a \in \mathbb R$.
