Find all $n \in \mathbb{N}$ S.T. $f^{n}$ exists on all of $\mathbb{R}$ Define $f$ on $\mathbb{R}$ by
$$f(x) :=
\begin{cases}
x^3,  & \text{if $x \geq 0$} \\[2ex]
0, & \text{if $x \lt 0$}
\end{cases}$$
find all $n \in \mathbb{N}$ such that $f^{n}$ exists on all of $\mathbb{R}$
I am not sure how to approach this problem. On one hand I can take derivatives all the way down to a constant, 6. Then I need to show that each derivative is defined everywhere on $\mathbb{R}$ i.e. show that each derivative is continuous through out $\mathbb{R}$. Theoretically I can show this for $f^{3}, f^{2},f^{1}$ right? 
 A: You have that
$$
\mathop {\lim }\limits_{h \to 0^ +  } \frac{{f''(0 + h) - f''(0)}}
{h} = 6
$$
while 
$$
\mathop {\lim }\limits_{h \to 0^ -  } \frac{{f''(0 + h) - f''(0)}}
{h} = 0
$$
$f''$ is not differentiable in $x_0=0$. Therefore your function does have a derivative on $\mathbb R$  only up to order 2.
In order to prove that $f'(0)$ does exists we have that
$$
\mathop {\lim }\limits_{h \to 0^ +  } \frac{{f\left( {0 + h} \right) - f(0)}}
{h} = \mathop {\lim }\limits_{h \to 0^ +  } \frac{{h^3 }}
{h} = \mathop {\lim }\limits_{h \to 0^ +  } h^2  = 0
$$
$$
\mathop {\lim }\limits_{h \to 0^ -  } \frac{{f\left( {0 + h} \right) - f(0)}}
{h} = \mathop {\lim }\limits_{h \to 0^ -  } \frac{0}
{h} = \mathop {\lim }\limits_{h \to 0^ -  } 0 = 0
$$
therefore we have that
$$
f'(x) = \left\{ \begin{gathered}
  3x^2 ,\,\,\,\,\,\,x \geqslant 0 \hfill \\
  0,\,\,\,\,\,x < 0 \hfill \\ 
\end{gathered}  \right.
$$
Now we can go further in the same way and prove that 
$$
f''(x) = \left\{ \begin{gathered}
  6x,\,\,\,\,\,\,x \geqslant 0 \hfill \\
  0,\,\,\,\,\,x < 0 \hfill \\ 
\end{gathered}  \right.
$$
When we investigate about f'''(0) we find the left and right limits above and therefore f'''(0) does not exists.
A: It may be helpful to consider what happens at $x = 0$, and to treat other values of x separately.  Basically, it's obvious that for $x \neq 0$ all of the derivatives exist.  You may be required to actually write something to explain why, but you should focus most attention on $x = 0.$
Do you have any trouble finding all $n \in \mathbb{N}$ such that $f^{n}(0)$ exists?
