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.
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).$$