Continuity and Differentiability at $x=0$ 
If $\displaystyle f(x)=\left\{\begin{matrix}
x^2+1 \;, x\leq 0 \\\\ 
 x^3\;, x>0
\end{matrix}\right..$ Then Differentiability of function $f(x)$ at $x=0$

Try: As we know that If function $f(x)$ is Differentiable at $x=0.$ Then it must be 
continuous at $x=0.$
$\displaystyle \Rightarrow f'(x)=\left\{\begin{matrix}
2x \;, x\leq 0 \\\\ 
 3x^3\;, x>0
\end{matrix}\right.$
$\displaystyle \Rightarrow f'(0)=\left\{\begin{matrix}
0 \;, x\leq 0 \\\\ 
 0\;, x>0
\end{matrix}\right.$
$\Rightarrow $ Function $f(x)$ is Differentiable at $x=0$
So it must be continuous at $x=0$
But From Question 
$\displaystyle \Rightarrow f(x)=\left\{\begin{matrix}
x^2+1 \;, x\leq 0 \\\\ 
 x^3\;, x>0
\end{matrix}\right.$
$\displaystyle \Rightarrow f(0)=\left\{\begin{matrix}
1 \;, x\leq 0 \\\\ 
 0\;, x>0
\end{matrix}\right.$
Here left side limit and Right side limit are not equal. 
So it is not Continuous at $x=0$
Could some explain me why this is happen.
 A: We have $$\lim_{h\to 0^+} \frac{f(h) - f(0)}{h} = \lim_{h\to 0^+} \frac{h^3 - 1}{h} = -\infty.$$ You can't just differentiate the parts of a piecewise function to check for differentiability precisely because the function might be discontinuous. The following statement holds: $$\textit{If $f:\mathbb{R}\to\mathbb{R}$ is defined by $f(x) = \begin{cases} f_1(x) & x\leq c\\ f_2(x) & x > c,\end{cases}$ where $f_1$ and $f_2$ are differentiable on $\mathbb{R}$,}$$
$$\textit{ then $f$ is differentiable on $\mathbb{R}$ if and only if $f_1(c) = f_2(c)$ and $f_1'(c) = f_2'(c)$.}$$  Moreover, it may be that the parts of the piecewise are not differentiable at the boundary of the sets on which they are defined but the piecewise function itself is. We can make another statement which removes the requirement of differentiability at $c$: $$\textit{If $f:\mathbb{R}\to\mathbb{R}$ is defined by $f(x) = \begin{cases} f_1(x) & x\leq c\\ f_2(x) & x > c,\end{cases}$ where $f_1$ and $f_2$ are continuous on $\mathbb{R}$}$$ $$\textit{and differentiable on $(-\infty, c)$ and $(c,\infty)$, respectively, then $f$ is differentiable on $\mathbb{R}$ if and }$$ $$\textit{only if $f$ is differentiable at $c$,which occurs precisely when}$$ $$\textit{$\lim_{h\to 0^+} \frac{f_1(x + h) - f_1(x)}{h} = \lim_{h\to 0^-} \frac{f_2(x+h) - f_2(x)}{h}$ and $f_1(c) = f_2(c).$}$$ Notice that in any case you need to check that $f_1(c) = f_2(c)$. The requirement that the derivatives of the constituent functions are equal (or their left and right derivatives) is a necessary but insufficient condition.
A: Your conclusion is clearly false, so there must be an error in the reasoning. Just test carefully each step, and you should find the error.
What happened here is you made an error when saying 'Function $f(x)$ is Differentiable at $x=0$'.
$f$ is not differentiable at $x=0$, because the $\lim_{h\to 0}\frac{f(h)-f(0)}h$ does not exist – the fraction converges to zero for $h< 0$ but it diverges to minus-infinity for $h>0$. So the limit does not exist. The derivative exists everywhere except zero, and it has limit $0$ as $x$ approaches $0$ from either side, but it does not exist at zero.
A: Here $$\Large\lim_{x\to 0^-}f(x)\ne\lim_{x\to 0^+}f(x)$$therefore the function has no limit and isn't continuous and differentiable.
A: This line
$$
\Rightarrow f'(x)=\left\{\begin{matrix}
2x \;, x\leq 0 \\\\ 
 3x^3\;, x>0
\end{matrix}\right.
$$
is incorrect.  What you can prove easliy is
$$
\displaystyle  f'(x)=\left\{\begin{matrix}
2x \;, x <  0 \\\\ 
 3x^3\;, x>0
\end{matrix}\right.
$$
See the difference?
