# What ranges to take while finding composition functions

A function is defined as $$f(x)=\begin{cases}-x,&\quad x<0\\x,&\quad 0\le x\le 1\\2-x,&\quad x>1 \end{cases}$$

How to find composite function function $f(f(x))$?

I can't understand what ranges are to be taken while evaluating the composition.

You should just walk through without thinking too much if you have a problem: If $x < 0$, $f(x) = -x > 0$. This means we need to account for the cases $0 \le -x \le 1$ and $-x > 1$, the former giving $f(f(x)) = -x$ for $-1 \le x < 0$ and the latter $2-(-x) = 2+x$ for $x < -1$. This already gives us the components $$f(f(x)) = \begin{cases} 2+x & x < -1 \\ -x & -1 \le x < 0 \\ ? & \text{else}\end{cases}$$ Proceed by walking through the other two cases for the inner $f(x)$ in a similar way.

• That was succint :-)!!Thanks a lot for the advice :-)!! – user227000 Apr 15 '15 at 8:22
• @SanchayanDutta After you ask a question here, if you get an acceptable answer, you should "accept" the answer by clicking the check mark ✓ next to it. This scores points for you and for the person who answered your question. You can find out more about accepting answers here: How do I accept an answer?, Why should we accept answers?. – AlexR Apr 15 '15 at 8:28