I'm going through Etgen's One and several variables (a book on calculus), and I came across the following question: Prove that the function
$$f(x) = \begin{cases} x^2 & x \le 1 \\ 2x & x \gt 1 \end{cases}$$
is not differentiable at $x = 1$. Using the definition of the derivative (the limit as $h \to 0$ of the difference quotient; i.e., $\lim_{h \to 0} \left( \frac{f (c + h) - f(c)}{h} \right)$), I found that the value of that limit of both the LHS and RHS is equal to $2$, so I assumed the limit must exist. But I also found that this function is not continuous at $x = 1$, so it should not be differentiable at that point.
In the same book, we had to prove that if the limit of the difference quotient exists at a real number $c$, then $f (x)$ is continuous at that point. I feel like I must be making a mistake somewhere, or misunderstanding what the definition of the limit is, so any help is appreciated.