Given by a graph is the function $f(x)$. How many solutions does $f(f(f(x)))=0$ have? This problem, like the other ones I've posted so far, is from a 2017 olympiad. It goes like this:
Given by the following graph is the function $f(x)$:

How many solutions does $f(f(f(x)))=0$ have?
In other words, how many time does the graph of $f(f(f(x)))$ touch or intersect the x-axis?
For me, the issue already lies in identifying $f(x)$. I know it must have something to do with $|x|$. How would one go about solving this problem?

Looking at the graph we have that:
$$f(f(f(x))=0\Leftrightarrow f(f(x))\in\{0,2\}\Leftrightarrow f(x)\in\{0,2,-2\}
\Leftrightarrow x\in\{0,2,-2,4\}.$$
P.S. Just for your curiosity: $f(x)=|x|-x+1-|x-1|$ and the graph of $f(f(f(x)))$ is
