The question is this:
Let $\Omega$ be a domain in the upper half plane $\mathbb{H} = \{ z \in \mathbb{C} ~|~ \Im~ z > 0 \}$. Let $f,g \in O(\Omega)$ holomorphic, such that $f(i) = 0~~$, $f$ is real-valued, and
$$ |f(z)|^2 + 2|g(z)|^2 = |z|^2$$
for all $z \in \Omega$. Determine $f$ and $g$.
This is my attempt at a solution:
let $z = i$, then $f(z) = 0$, and $ 2|g(z)|^2 = |z|^2 = |i|^2 = 1$
Therefore, $$ |g(i)| = 1/2~~~\star$$
Then consider $z \in \Omega$ such that $z \neq i$, then:
$$|f(z)|^2 + 2|g(z)|^2 = |z|^2$$ $$f \bar{f} + 2 g \bar{g} = z \bar{z}$$ $$\frac{\partial }{\partial \bar{z}}(f \bar{f}) + 2\frac{\partial}{\partial \bar{z} }(g \bar{g}) = \frac{\partial}{\partial \bar{z}}(z \bar{z})$$ $$f\frac{\partial \bar{f}}{\partial \bar{z}} + \bar{f}\frac{\partial f}{\partial \bar{z}} + 2(g\frac{\partial \bar{g}}{\partial \bar{z}}+ \bar{g} \frac{\partial g}{\partial \bar{z}}) = z$$
The first 2 terms are $0$ since $f$ is real valued so $f = \bar{f}$ and since $f$ is holomorphic, the derivative with respect to $\bar{z}$ is also $0$. Also the last term is $0$ since $g$ is holomorphic.
So we are left with : $$ 2g\frac{\partial \bar{g}}{\partial \bar{z}} = z$$ $$2g \overline{\frac{\partial g}{\partial {z}}} = z$$
Then $$2gg'(z) = z~~~\star \star$$
This is where I am stuck. I don't know what to do with the information on $g$ and if I find it I can find f but I don't know how to proceed from here.
Any help would be appreciated.