If $f(x) = |x-2| , x\in ]2,4[$ , then $f(f(x)) = ?$
- a) $-x$
- b) $4-x$
- c) $x-4$
- d) $x$
My turn :$$D_f= ]2,4[ , f(x) = x -2$$ To do the composition we need $$2<|x+2|<4 , x\in ]0,4[$$ Then the domain of the composition is $$]2,4[$$ Then $$f(f(x)) = |x-2| -2 = x -4$$ Is my solution correct?
For $x\in]2,4[$, it is $x-2\in]0,2[$, so $x-2>0$ and $$ x-2=|x-2|.\tag{1} $$
Hence, $|x-2|-2\in]-2,0[$, so $|x-2|-2<0$, this is $$ |x-2|-2=-||x-2|-2|.\tag{2} $$
You can compose $f(f(x))=||x-2|-2|$ on any interval of $\mathbb R$ and, for $(2)$ and $(1)$, in $]2,4[$ we have: \begin{align} ||x-2|-2|&=-(|x-2|-2)\\ &=-|x-2|+2\\ &=-(x-2)+2\\ &=-x+2+2=-x+4.\\ \end{align}
I was puzzled in the beginning, but the answer is b): $4-x$.
Image:
(Wolfram|Alpha agrees :))