The condition is equivalent to $g(z)=(1-i)f(z)$ is real for all complex $z$. Note that if $f=k+ik$, then $(1-i)k(1+i)$ is real. The imaginary part of $g(z)$ vanishes - it's an equivalent way to phrase your condition.
The derivatives of $g(z)$ with respect to $z$, which exists because $g(z)$ is holomorphic just like $f(z)$, can be calculated as $\frac{dg(z)}{dz} = \frac{dg(z)}{dz_1} = \frac{\partial g_1(z)}{\partial z_1} + i \frac{\partial g_2(z)}{\partial z_1} = \frac{\partial g_2(z)}{\partial z_2} + i\frac{\partial g_2(z)}{\partial z_1}$ by the Cauchy-Riemann equations. I used one of the Cauchy-Riemann equation to rewrite the partial derivative of the real part (the first term) to a derivative of the imaginary part. Note that the first step was to define the derivative with respect to $z$ as the derivative with respect to the real part of $z$. It's really the same thing for holomorphic functions.
If the first or second term has a wrong sign, or if the $i$ should be in the first term and not the second, it doesn't make a difference. But because the imaginary part of $g$, $g_2$, was assumed to be zero, $dg_2(z)/dz$ is zero as well, and therefore $g$ is constant, and therefore $f$ is constant, too.
A more general message: Pretty much any similar constraint unnaturally depending both on the real and imaginary part - instead of the whole $z$ itself - will force any holomorphic function to be constant. Holomorphic functions are really meant to make the operations "real part" and "imaginary part" inappropriate. That's because the "real part" and "imaginary part" are not holomorphic functions themselves.