Checking Differentiability Of g(x) Using Information Of f(x) (unsolved) 
Let $$f(x)=e^{x+1}-1, g(x)=p|f(x)|-\sum_{k=1}^n|f(x^k)|, n \in \mathbb N$$
It is given that $g(x)$ is a differentiable function over the complete real numbers. If value of $p=100$, then sum of possible values of $n$ is $\dots$

I basically couldn't think of any way to start with this problem, Clearly $|f(x)|$ is not differentiable at $1$ point whereas in even powers ($f(x^{2n}))$ of $f(x)$, the function is differentiable at all points. Simply speaking, for odd values of $k$, function will not be differentiable but for even values of $k$, the function is differentiable at all points. But I have no clue on how to apply this concept in this question. The series is getting too long with none satisfactory results nor any hint for approaching this problem.
EDIT: Can somebody please elaborate Ashish Ahuja's answer more? For checking differentiability at $x=-1$ (as suggested by below answer), how can we proceed? I suppose we can calculate the answer ($n=19,20$) from here, but how? Also have a look at my answer below and kindly spot my mistake please. How can we confirm that the problem only occurs at $x=-1$ and not other numbers? Thank You
 A: Hint:
The function of the form
$$
k|e^{x+1} - 1| - |e^{x^k+1}-1|
$$
is differentiable at $x = -1$. Using this along with what you've already noted will allow you to arrive at the answer.
A: From what I have understood from the above answer, $g(x)$ is continuous at $x=-1$. So I separated $g(x)$ into two parts: $$x\gt -1,x\lt -1$$
For an odd number $k$, $$x\lt -1, f(x^k) \lt 0$$
$$x \gt -1, f(x^k) \gt 0$$
For an even number $l$, $$f(x^l)\gt 0 \space \space\space \forall x \in \mathbb R$$
$$
g(x)=
\begin{cases}
-100f(x)-\bigg(-f(x)+f(x^2)-f(x^3)+f(x^4)- \dots\bigg), & x \lt -1 \\
100f(x)-\bigg(f(x)+f(x^2)+f(x^3)+f(x^4)+ \dots\bigg), & x \gt -1
\end{cases}
$$
Now derivating $g(x)$ once,
$$
g'(x)=
\begin {cases}
-100f'(x)-\bigg(-f'(x)+2xf'(x^2)-3x^2f'(x^3)+4x^3f'(x^4)- \dots\bigg), & x \lt -1 \\
100f'(x)-\bigg(f'(x)+2xf'(x^2)+3x^2f'(x^3)+4x^3f'(x^4)+ \dots\bigg), & x \gt -1 \\
\end {cases}
$$
Now applying the condition, $g'((-1)^+)=g'((-1)^-)$, we get
$$1+3+5+ \dots n=100$$
But this gives $n=10$ which is not the correct answer. The correct answer is $$n=19,20$$
Can anyone please spot my mistake or any alternative method?
