Find all analytic functions $f(z) = u(x,y)+iv(x,y), z \in \mathbb{C}$ such that $\frac{\Re(f(z))}{\Im(f(z))} = \frac{u(x, y)}{v(x, y)} = g(x).$ 
Find all analytic functions $f(z) = u(x,y)+iv(x,y), z \in \mathbb{C}$
such that $$\frac{\Re(f(z))}{\Im(f(z))} = \frac{u(x, y)}{v(x, y)} =
 g(x).$$ $g(x)$ is a function only of $x$, and doesn't depend on $y$.

$$f(z) = g(x)\cdot v(x,y) + i v(x,y).$$
Cauchy-Riemann equations hold for analytic functions:
$$
u_x=v_y, u_y = -v_x.
$$
From the required property,
$$
0 = \frac{u_yv - uv_y}{v^2} \Rightarrow -vv_x - uv_y= -vv_x -g(x)vv_y=0 \Rightarrow v_x + g(x)v_y = 0, \frac{dx}{1} = \frac{dy}{g(x)} \Rightarrow v = F(G(x)-y),
$$
where $G'(x)=g(x),$ and $F$ is an arbitrary differentiable function.
Is this solution correct? I am not sure this is correct, and am not sure if complete. From $u_x=v_y,$
$$
g'F + g^2F' = -F',
$$
but I am not sure this is solvable, since argument of $F$ is $G(x)-y$, not $x$.
Thank you.
 A: First let's prove that if $f=u+iv,f_1=u_1+iv_1$ are analytic functions on some domain, that are not identically zero and st $uv_1=u_1v$. then $f=kf_1$ for some non zero real $k$. This follows because the hypothesis implies $uf_1=u_1f, vf_1=v_1f$ hence $\bar f f_1=\bar f_1 f$ or $f_1/f$ is holomorphic and anti-holomorphic outside the discrete zeroes of $f$, so is a constant there and hence on all the domain. But $f_1=kf$ and $f_1/f=\bar f_1/\bar f$ implies $k=\bar k$ so $k$ real non zero.
Coming back to the problem, we can assume wlog $f$ nonconstant (constants clearly satisfy the condition at least if $\Im f \ne 0$ to make sense) so $f'$ not identically zero.
But now we notice that if $f=u+iv$ one has $f'=u_x+iv_x=v_y-iu_y$ so $if'=u_y+iv_y=f_y$ and clearly $u=g(x)v$ implies $u_y=g(x)v_y$ so $uv_y=g(x)vv_y=vu_y$ so by the above, we have $f=ikf'$ hence $f(z)=Ke^{ikz}, K \ne 0$ and $k$ real nonzero, while $K$ can be any complex nonzero number and by subsuming the constant $f$ case, we have that $f(z)=Ke^{ikz}$ for any $k$ real and $K$ complex non zero (where in the constant case $k=0$ we also want $\Im K \ne 0$ for the denominator to make sense)
