Great question. The answer is that you can write $f$ as a power series. We see that if $f$ is a holomorphic function such that $f(a)=0$, then $f(z)/(z-a)$ is holomorphic at all points in the domain of $f$, except possibly at $z=a$. I will show that it is actually holomorphic at $z=a$, and so $f(z)/(z-a)$ is holomorphic on the whole domain of $f$.
Locally we have that $f(z)=a_1(z-a)+a_2(z-a)^2+\cdots$ (we could have that $a_1=0$, but there is at least no constant term since $f$ is zero at $a$), and $f'(z)=a_1+2a_2(z-a)+\cdots$. We have that $f(z)/(z-a)=a_1+a_2(z-a)+\cdots$ and is holomorphic at $a$. Moreover, to get the decomposition you are looking for, we get from the equations that
$$f(z)=(z-a)((a_1+2a_2(z-a)+3a_3(z-a)^2+\cdots)-(a_2(z-a)+2a_3(z-a)^2+\cdots)$$
$$=(z-a)(f'(z)+g(z)),$$
where $g(z)=-(a_2(z-a)+2a_3(z-a)^2+\cdots)=-\sum_{k=1}^\infty ka_k(z-a)^k$. This is holomorphic close to $a$ and is easily seen to extend to the whole domain of $f$ (since $g(z)=f(z)/(z-a)-f'(z)$, which is defined everywhere on the domain of $f$).
Of course if you don't want to use power series and already know that $f(z)/(z-a)$ is holomorphic, then you can write
$$f(z)=(z-a)(f'(z)+(\frac{f(z)}{z-a}-f'(z))),$$
which is what you have written.