I have a function $$f(x)= \begin{cases} x & \text{if } x \ge0 \\ x^2 & \text{if } x<0 \end{cases} $$ and want to show that it is continuous but not differentiable at $x=0$
Now to show that a function is differentable we show that $$f'(x_0)= \lim_{x \to x_0}\frac{f(x)-f(x_0)}{x-x_0}$$
but I am always confused with such funtions. Do I have to choose $x$ or $x^2$
Taking the comments into consideration a functions is differentiable if the difference quotient $\frac{f(x)-f(x_0)}{x-x_0}, x_0\ne0$ approaches a limit. And limit exist only if left- and right-hand side limit is equal. So $$\lim_{x \to 0^-}= \frac{x^2-0}{x-0}=\frac{x^2}{x}=x=0$$ and $$\lim_{x \to 0^+}= \frac{x-0}{x-0}=\frac{x}{x}=1$$ thus they are not equal which means f is not differentiable.
For the continuity part I am considering the definition: $\forall \varepsilon >0 \ \exists \delta>0$ s.t $\mid f(x)-f(x_0)\mid < \varepsilon$ if $\mid x-x_0 \mid < \delta.$