Informally, $\lim_{x \to p} f(x)=L$ means "when f is applied to any input sufficiently close to p, the output value is forced arbitrarily close to L". In the picture, when $x$ is sufficiently close to 6, $f(x)$ can be arbitrarily close to $2$ and always larger than $2$. Then $f(f(x))$ can be arbitrarily close to $5$, since the curve in $x\leq2$ is not used at all.
$\lim_{x \to 6} f(f(x))=L$ is defined to mean:
For all $\varepsilon>0$, there exists a $\delta>0$ such that for all $x$ (in $D$) that satisfy $0<|x-6|<\delta$, the inequality $|f(f(x))-L|<\varepsilon$ holds.
Let $L=5$. For all $\varepsilon>0$, we select $\delta$ using the following steps:
- $e = \min{\{\varepsilon, 0.5\}}$.
- Solve $f(d)=5-e$. Since $0<e<1$ we can get a solution in $(2,3)$. Name it $d$.
- Solve $f(c)=d$. There are 2 solutions in $(3,6)$ and $(6,9)$ (note $2<d<3$). Name them $c_1, c_2$.
- $\delta=\min{\{|6-c_1|,|c_2-6|\}}$.
Now, for all $x$ that satisfy $0<|x-6|<\delta$, $x$ is nearer to $6$ than both $c_1$ and $c_2$, so $c_1<\delta<c_2$ (and $\delta \neq 6$). Therefore from the picture, $2<f(x)<d$, and $5>f(f(x))>5-e$, so $|f(f(x))-5|<e\leq\varepsilon$ holds.
Thus from the definition $\lim_{x \to 6} f(f(x))=5$.