If $f$ is holomorphic on a domain $D$, and satisfies $a\operatorname{Re}(f(z))+b\operatorname{Im}(f(z))=c$ for all $z\in D$, then $f$ is constant The proposition that I am required to prove is the following

Let $D \subset \mathbb{C}$ be a domain and suppose $f(x, y)=u(x,
 y)+iv(x, y)$ is holomorphic on $D$. Let $a, b, c\in \mathbb{R}$ such
  that $a^2+b^2>0$ and  $$au(x, y)+bv(x, y)=c \quad \forall z=(x, y)\in D$$
Prove $f$ is constant

I will write $u(x, y)$ as $u$ in short, and similarly for $v(x, y)$.
My attempt is as follows:
Since f is holomorphic we have: 
$$\dfrac{\partial u}{\partial x}=\dfrac{\partial v}{\partial y}\qquad \dfrac{\partial u}{\partial y}=-\dfrac{\partial v}{\partial x}$$
If $a=0\neq b$, then $bv=c \implies v=K\in\mathbb{R}$
$$\implies \dfrac{\partial u}{\partial x}=\dfrac{\partial v}{\partial y}=\dfrac{\partial u}{\partial y}=-\dfrac{\partial v}{\partial x}=0$$
$$\implies f'(z)=0 \quad \forall z\in D$$
Similarly for $a\neq 0=b$
Now the remaining case to check is if $a\neq 0\neq b$
Taking partial derivatives both sides of the given relation we get:
$$a\dfrac{\partial u}{\partial x}+b\dfrac{\partial v}{\partial x}=0$$
$$\implies \dfrac{\partial u}{\partial x}=\dfrac{b}{a}\bigg(-\dfrac{\partial v}{\partial x}\bigg)=\dfrac{b}{a}\dfrac{\partial u}{\partial y}$$
Similarly taking partial derivatives w.r.t $y$ we get:
$$\dfrac{\partial u}{\partial x}=-\dfrac{a}{b}\dfrac{\partial u}{\partial y}$$
$$\implies \dfrac{a}{b}=\dfrac{-b}{a}$$
$$\implies a^2+b^2=0$$
This is a contradiction, so it is not possible that $a\neq 0\neq b$. Therefore for all possible values of $a$ and $b$, the function $f$ is constant.
 A: Yes, it is correct.
Note that, after having proved it for the case in which $a=0$ or $b=0$, you could use that to prove it in the general case, since$$au+bv=\operatorname{Re}\bigl((a-bi)(u+vi\bigr).$$
A: In the case $a \ne 0 \ne b$ you obtained the identities
$$
\frac{\partial u}{\partial x} = \frac ba \frac{\partial u}{\partial y} \\
\frac{\partial u}{\partial x} = -\frac ab \frac{\partial u}{\partial y}
$$
At that point you should conclude that 
$ \frac{a}{b}=\frac{-b}{a}$ or $\frac{\partial u}{\partial x} = \frac{\partial v}{\partial x} = 0$. The first case leads to a contradiction, therefore $f'(z)=0$.

You don't have to consider the cases $a=0$ or $b=0$ separately if you proceed
as follows: Differentiating with respect to $x$ gives
$$
a\frac{\partial u}{\partial x}+b\frac{\partial v}{\partial x}=0
$$
Differentiating with respect to $y$ and applying the Cauchy-Riemann
equations gives
$$
b\frac{\partial u}{\partial x}-a\frac{\partial v}{\partial x}=0
$$
That is a linear equation system, and its coefficient determinant is $-a^2-b^2 \ne 0$. It follows that it only has the trivial solution
$$
\frac{\partial u}{\partial x} = \frac{\partial v}{\partial x} = 0
$$
