Can we take individual derivative of piecewise function if the function is continuous and differentiable?
Suppose a function $f(x)$ is defined in such a way that it's definition changes at some particular point, say $x = a$. If it's given a priori that $f(x)$ is continuous and differentiable at point $x = a$, can we just individually take derivative of one of the function and find it's value at $x = a$?
For example, $$f(x) = \begin{cases} x^2 & \text{if}\ x \geq 1 \\ 2x - 1 & \text{otherwise} \end{cases}$$
This function is continuous and differentiable at $x=1$. Here the derivative also equals $$2 = 2(1) \text{ (derivative of } x^2 \text{ at 1}) = 2 \text{ (derivative of } 2x \text{ at 1})$$
Is this true for all functions given to be continuous and differentiable at some point (that value of individual derivative equals actual derivative)?