This is what you meant? If it is, I don't understand why we have to do this to obtain the analytic continuation for the whole complex plane.

Yes, that is what I meant (apart from the mistake at the end). The reason for doing it that way is that if you want f to be an analytic function of z then you have to express it in terms of z. Fortunately, you end up with the expression , which certainly is analytic on the whole complex plane, and therefore gives the required analytic continuation for f(z).