In order for the complex derivative to exist, the differential quotient must be the same for any sequence approaching z_0.

For g(z)=Im z you can find 2 complex sequences approaching z_0, for which the differential quotient is different.

Take for example

a_n:=z_0+i/n

and b_n:=z_0+1/n