Can a function be differentiable at a jump discontinuity? I learnt in spivak's calculus that if a function is differentiable at a point then it is continuous at that point however I am confused about this function for example
$$
f(x)=\begin{cases}
-2x & x<4, \\
8 & x=4. 
\end{cases}
$$
Is this function differentiable at $x=4$ since this point is an isolated point of the functions range the function is continuous at that point.
However why can we not calculate the derivative at $x=4$ the right hand limit need not exsist as the function is not even defined for values of x greater than 4 so why is the derivative not defined ?
 A: The (one-sided) derivative at $4$ would be
$$ \lim_{x\to 4} \frac{f(x) - f(4)}{x-4} = \lim_{x\to 4} \frac{-2x - 8}{x-4} = \lim_{x\to 4}\left(-2- \frac{16}{x-4} \right)$$
which doesn't exist. So $f$ is not differentiable at $4$, nor is it continuous at $4$: $$\lim_{x\to 4} f(x) = -8 \neq f(4).$$
In order to define a meaningful notion of "the limit of $f(x)$ as $x$ approaches $a$" you need $a$ to be a limit/cluster point of the domain of $f$. So in particular if $a$ is an interior point then you can define the two-sided limit that you're used to. If $a$ isn't an interior point, but still a cluster point, then you can still talk about the limit as $x \to a$ but just be careful that some of the theorems you have seen might no longer apply if $a$ is not an interior point.
In this case, however, it is still true that if $f$ is differentiable at $a$ (with $a$ a cluster point) then $f$ is continuous at $a$.
A: As pointed out in the comments, $f$ is not continuous at $4$, since $\lim_{x\rightarrow 4^{-}}f(x)=-8\neq f(4)$. Recall that $x\in D(f)$ is an isolated point of the domain if there exists $\delta> 0$ such that $[(x-\delta,x+\delta)\setminus \{x\}]\cap D(f)=\emptyset$. Check that this is not the case.
Now, differentiability $\Rightarrow$ continuity still holds for left-differentiability and left-continuity. As the function is not left-continuous, it cannot be left-differentiable at $x=4$.
A: This is just a question of definition. If you look at the definition of left-differentiability (here, for instance), you will see that according to that definition your function is not left-differentiable at $x=4$. And that's that.
A: It doesn't make sense to ask whether $f$ is continuous at 4 because differentiability is only defined for interior points of the domain, but 4 lies on the boundary.
