I am wondering how $\lim_{x \to 0} f(x) = 0$ but $\lim_{x \to 0} f(f(x)) = 1$ is possible. Since $\lim_{x \to 0} f(f(x))$ = $f(\lim_{x \to 0} f(x)) = \lim_{x \to 0} f(x) = 0$ but not $1$.
I think this has something to do with discontinuity at $0$ but I am not able to sketch a graph satisfying this.
Take $$f(x) = \begin{cases}0 & x\neq 0 \\ 1 & x=0\end{cases} $$
Then $\lim_{x \to 0} f(x) = 0$ since in any neighbourhood of $0$ the function is $0$. But note that $$f(f(x)) = \begin{cases} 1 & x\neq 0 \\ 0 & x = 0\end{cases}$$
So $\lim_{x \to 0} f(f(x)) = 1$ since in any neighbourhood of $0$ the function is $1$.