It appears that you have a hard time trying to come to terms with this example where chain rule does not apply. But then you have to understand that chain rule is a one way implication:
If $g$ is differentiable at $a$ and $f$ is differentiable at $g(a)$ then $f\circ g$ is differentiable at $a$.
The following converse does not hold:
If $f\circ g$ is differentiable at $a$ then $g$ is differentiable at $a$ and $f$ is differentiable at $g(a)$.
In your example the function $G(x) = e^{|x|} - 1$ is not differentiable at $0$ and $F(x) = \cos x$ is differentiable at $G(0) = 0$ and yet $F\circ G$ is differentiable at $0$. Here is an intuitive way to look at this. Since we are only interested in the troublesome point $x = 0$ we need to analyze the behavior of $f(x) = \cos(e^{|x|} - 1)$ near point $x = 0$. Now if $x$ is near $0$ then $e^{|x|} \approx 1 + |x|$ and hence $f(x) \approx \cos |x| = \cos x$ so that the modulus sign goes away and we should expect $f$ to be differentiable there.
Note that the even nature of $\cos$ plays a significant role here. The function $g(x) = \sin (e^{|x|} - 1)$ looks similar but is not differentiable at $0$. You should be able to show in general that if $F$ is an even function differentiable at $0$ then $F'(0) = 0$ and if $g(x) = F(e^{|x|} - 1)$ then $g'(0) = 0$.