Main Question: Is it possible for a function f to have a derivative at a point x but be discontinuous at that point?
Consider a function that is defined as follows:
$$f(x)=\begin{cases} x^2 & x \leq c \\ax+b & x > c \end{cases}$$
We are asked to find constants a,b,c such that the derivative of f at c exists. Consider the situation where $a=2c$. Following the limit definition of the derivative, we have that $f'(c)$ is equals to:
$$\lim_{h\to0}\frac{f(c+h)-f(c)}{h}$$ provided that the limit is defined.
To see that, we may examine the limit as $x\to0-$ and as $x\to0+$.
$$\begin{equation}\lim_{h\to0+}\frac{f(c+h)-f(c)}{h} \\ =\lim_{h\to0+}\frac{a(c+h)+b-(ac+b)}{h}\end{equation}\\=\lim_{h\to0+}\frac{ah}{h}\\=a=2c$$
For when $x\to0-$:
$$\begin{equation}\lim_{h\to0-}\frac{f(c+h)-f(c)}{h} \\ =\lim_{h\to0-}\frac{(c+h)^2-c^2}{h}\end{equation}\\=\lim_{h\to0-}\frac{2ch+h^2}{h}\\=2c$$ Thus, by definition if $a=2c$ then for all values b $f'(c)$ exists and is equal to 2c. Here is the issue, if $f'(c)$ exists for all values of b with the aforementioned condition then it could certainly be possible that $f(x)$ is discontinuous at c which contradicts an earlier theorem which states that if a function f has a derivative at a point x, then it is also continuous at x.
This is an example graph in desmos: https://www.desmos.com/calculator/acym19fdm2.
This creates a situation where the function f has a derivative at the point x but it is not continuous at that point. Am I doing something wrong here?
Edit: As X-Rui and many others in the comments and answers pointed out, my error was in computing the right-hand limit. f(c) should always be equal to $c^2$ regardless of the limit since c is constant and f(c) was so defined. Hence the right-hand side limit computation should be as follows:
$$\begin{equation}\lim_{h\to0+}\frac{f(c+h)-f(c)}{h} \\ = \lim_{h\to0+}\frac{a(c+h)+b-c^2}{h}\end{equation}$$
From here we intend to find an values of a,b,c such that this limit will agree with the value of the left limit of 2c. Assume that there exists such a value c, then since f is differentiable at c f is continuous at c. Hence $ac+b=c^2$ by continuity (as pointed out by stoic-santiago). Then the limit above simplifies to $$\lim_{h\to0+}\frac{a(c+h)+b-(ac+b)}{h}=a$$ Hence our requirement of differentiability simplifies to the requirement that $a=2c$ (along with the above requirement for continuity).
Therefore, any a,b,c satisfying the two conditions $ac+b=c^2$ and $a=2c$ will suffice.