Is there some "types" of "discontinuous derivative"? I'm just started learning standard Calculus class in the university (It treats James Stewart's "Essential Calculus: Early transcendentals" for 1 semester, just letting you know) and I got some questions about the relationship between 'differentiability of a function' (i.e.the existence of $f'(a)$ regarding $x = a$) and 'continuity of a derivative of function'.
I made a derivative of a function on my own, which is
$$f'(x)=\begin{cases}-x + 2 & x<0, \\ 1 & x=0, \\ -x & x>0. \end{cases}$$
I said the integral constant $C = 0$ arbitrarily for convenience. Because $f'$ is defined at every $R$, then $f$ is continuous at every $R$ by theorem (don't remember the number of it...) By integrating $f'$ at every interval, then we get
$$f(x)=\begin{cases} -x^2/2 + 2x & x<0, \\ 0 & x=0, \\ -x^2/2 & x>0. \end{cases}$$
But by using the definition of $f'(0)$ and given $f(x)$, we have to say that $f'(0)$ doesn't exist! So this was a contradiction. I asked about this in my country's internet community, but the answers were the following.

"If $f'(a)$ exists, and $f'$ is not continuous at a, then there are 2 types.

*

*Both left and right limit of $f'$ at $x = a$ exists but $f'$ is not continuous at $a$


*Either left or right limit of $f'$ at $x = a$ doesn't exist, so $f'$ is not continuous at $a$.
$f'$ is only available at type 2.

I just accepted with no excuse, but after few days, I just wanted to know some prove about this.
I read about this but as I said before, I just started Calculus, so it was too hard for me to understand some comments at there.
I am not American or British, so I'm not very good at English and sorry about that.
Question is that could somebody prove that "if $f'(a)$ exists and $f'$ is discontinuous at $x = a$, then left-hand or right-hand limit of $f'$ at $x = a$ doesn't exist."
Thx for reading this awful long writing.
 A: The answer you quoted in your question is nonsense. Here is a well-known fact for a given function $f$:

If $f'(a)$ exists, then both left and right derivatives $f'_-(a)$ and $f'_+(a)$ exist and we have $f'(a) = f'_-(a) = f'_+(a)$.
If both $f'_-(a)$ and $f'_+(a)$ exist and $f'_-(a) = f'_+(a)$, then $f'(a)$ exists.

Two obvious consequences are:

*

*If one of $f'_-(a)$ and $f'_+(a)$ does not exist, then $f'(a)$ does not exist.


*If both $f'_-(a)$ and $f'_+(a)$ exist and $f'_-(a) \ne f'_+(a)$, then $f'(a)$ does not exist.
The continuity of $f'$ in $a$ does not have anything to do with  $f'_-(a)$ and $f'_+(a)$. First note that to speak about the continuity of $f'$ in $a$ requires that $f'(x)$ exists in some open interval containing $a$, and this is not guaranteed by the mere existence of $f'(a)$. But even if that is satisfied, the continuity of $f'$ in $a$ is an additional feature.
Let us look at your $f'$. First you should not write $f'$ because this suggests that your function is the derivative of some $f$ which you cannot know to be true without a proof. So write $g$ instead of $f'$ and ask

Is $g$ the derivative of some $f$?

As you have shown, the answer is "no". But this has nothing to do with the discontinuity of $g$ in $0$. There are examples of discontinuous functions appearing as derivatives. See malklera kwezibalo's answer.
The function $f$ which you found is continuous and has a (continuous) derivative in all $a \ne 0$. Moreover, $f'_-(0)$ and $f'_+(0)$ exist, but are different. Thus $f'(0)$ does not exist.
A: Consider the function $f\colon\mathbb{R}\to\mathbb{R}$ given by $x\mapsto x^2\sin(\frac{1}{x})$. This function is continuos in $x=0$ because $\lim_{x\to0}f(x)=0$.
The derivative for $x\neq0$ is $$f'(x)=2x\sin(\frac{1}{x}) - x^2\cos(\frac{1}{x})\frac{1}{x^2}=2x\sin(\frac{1}{x}) - \cos(\frac{1}{x})\qquad x\neq0$$
and $f'(x)$ do not exists on $x=0$. However, doing the limit of incremental you have
$$\lim_{h\to 0}\frac{f(0+h)}{h}=\lim_{h\to 0}\frac{h^2\sin(\frac{1}{h})}{h}=\lim_{h\to 0}h\sin(\frac{1}{h})=0$$
because $-1<\sin(\alpha)\leq1$ is bounded and $h\to0$.
