What should actually be demonstrated in this exercise about left and right derivatives? I am redoing my math education after 35 years in order to be up to date with my children's curriculum (I usually have a nanosecond to give an answer because of magical dad knowledge). My older son is in high school and they are going through derivatives.
One of the exercises I was preparing for him (this is beyond the homework, he is in an "advanced" track and I want to show him some more interesting problems) I stumbled upon the following problem. It is a translation from French so feel free to edit in order to improve the wording

We define
$$
\begin{align}
f: \mathbb{R} & \rightarrow \mathbb{R} \\
x & \mapsto \begin{cases}
      \text{$x^2 - 1$ if $x < 0$} \\
      \text{$x^2 + 1$ if $x \geq 0$}
    \end{cases}      
\end{align}
$$
Demonstrate that, for $a=0$, $f$ is derivable on the right but not on the left.

Both $x^2 - 1$ and $x^2 + 1$ are derivable in $\mathbb{R}$ but $f$ is defined for $0$ as $x^2 + 1$. So technically the derivative in $0$ will be $2 \times 0 = 0$
It is however derivable on $0^+$ ($2x$) and on $0^-$ ($2x$).
The only idea I have is that by taking the definition of the left derivative I have
$$ \lim_{h \rightarrow 0^-} \frac{f(x+h) - f(x)}{h} $$
which I think is not defined because the limit approaching on the left does not exist (as the function is undefined there). But I think I must be missing something because this is too obvious.
 A: You are on the right track, but as I note in a comment, you are somewhat oversimplifying.
We do want to use the definitions of left/right derivative, so let's do that.
$$\lim\limits_{h\to0^-}\frac{f(x+h)-f(x)}h=\lim\limits_{h\to0^-}\frac{(0+h)^2-1-(0^2+1)}h=\lim\limits_{h\to0^-}\frac{h^2-2}h=\infty$$
$$\lim\limits_{h\to0^+}\frac{f(x+h)-f(x)}h=\lim\limits_{h\to0^+}\frac{(0+h)^2+1-(0^2+1)}h=\lim\limits_{h\to0^+}h=0$$
There is no such thing as an infinite derivative, so this shows that only the right derivative is well defined at $0$.
A: To determine whether or not $f'(c)$ exists, one can see if the following is true:
$$\lim_{x\to c^+}\frac{f(x)-f(c)}{x-c} = \lim_{x\to c^-}\frac{f(x)-f(c)}{x-c}.$$
If either the LHS or RHS to the above equation does not exist, or the LHS and RHS exists but have different values, then $f'(c)$ does not exist.
For your piecewise function, let's determine whether or not the derivative of $f$ at $c = 0$ exists.
$\lim_{x\to 0^+}\left(\frac{f(x)-f(0)}{x-0}\right) = \lim_{x\to 0^+}\left(\frac{x^2+1 - 1}{x}\right) = \lim_{x\to 0^+}\left(x\right) = 0.$
However,
$\lim_{x\to 0^-}\left(\frac{f(x)-f(0)}{x-0}\right) =  \lim_{x\to 0^-}\left(\frac{x^2-1 - 1}{x}\right) = \lim_{x\to 0^-}\left(\frac{x^2-2}{x}\right) = \lim_{x\to 0^-}\left(x - \frac{2}{x}\right) \to +\infty,$
or rather it's more proper to say that the latter limit does not exist.
Since the second limit does not exist, $f'(0)$ does not exist.
