In Complex Analysis by Bak & Newman, if $f$ is entire, $g$ is defined as: $g(z)=\begin{cases} \frac{f(z)-f(a)}{z-a} &z\ne a\\ f'(a) &z=a \end{cases} $
I don't understand why this is. Is $g$ the derivative of $f$? What is going on here?
Here is a screenshot of what is being said. Why is $g$ being defined this way? There is no motivation.

No, $g$ is not the derivative of $f$. Nobody can tell you what is going on here unless you say in which context $g$ is being defined.