Identity Principle for square roots Suppose that on a Domain, $D,$ there exists analytic functions $f(z), g(z)$ so  that $\Re \sqrt{f(z)} = \Re \sqrt{g(z)}$ and $f(0)=g(0)=0$ on $D.$  Here the branch is taken to be the principal branch $(-\pi,\pi]$
Is it true that $f(z)=g(z)$?  Does this hold true for $s$-roots.
 A: I am assuming that the branch cut for $\sqrt{z}$ is the negative real axis, which seems to be implied by what was written.
First assume that $f$ is not identically 0. By the open mapping theorem, there exists $z_{0} \in D\setminus \{ 0\}$ where $f(z_{0})$ is a positive real number. Then $0 < \sqrt{f(z_{0})}=\Re\sqrt{f(z_{0})}=\Re\sqrt{g(z_{0})}$. So there exists $\epsilon > 0$ such that $B_{\epsilon}(z_{0})$ is mapped by $\sqrt{f}$ and by $\sqrt{g}$ into the strip 
$$      S= \left\{ w :  0 < \frac{1}{2}\sqrt{f(z_{0})} < \Re w < \frac{3}{2}\sqrt{f(z_{0}} \right\}.
$$
The set $S^{2}=\{ w^{2} : w \in S\}$ excludes all points of the negative real axis.
Therefore $h=\sqrt{f(z)}-\sqrt{g(z)}$ is holomorphic on $B_{\epsilon}(z_{0})$ and $\Re h = 0$ on $B_{\epsilon}(z_{0})$. So there exists a real constant $C$ such that
$h(z)=iC$ for all $z \in B_{\epsilon}(z_{0})$. Hence the following identity holds:
$$
          f(z) = (\sqrt{g(z)}+iC)^{2} = g(z)+2iC\sqrt{g(z)}-C^{2},
$$
$$
           (f(z)-g(z)+C^{2})^{2} = -4C^{2}g(z), \;\;\; z \in B_{\epsilon}(z_{0}).
$$
The last identity must then hold on all of $D$ because the functions are holomorphic on the full connected domain $D$ and equal on an open set. Therefore, letting $z=0$ in this last identity, one finds that $C=0$, which implies $f=g$ on $D$.
Finally, in the remaining case, assume $f$ is identically $0$. Then $\Re\sqrt{g(z)}=0$ for all $z$. Either $g$ is identically $0$ or, using the same technique as above, $\sqrt{g}=iC$ on some open neighborhood, which implies $g=-C^{2}$ on all of $D$. But $g(0)=0$ implies $C=0$. So $f=g$ on $D$ in this case, too.
For powers $n > 2$ or non-integer powers, I'm not sure how modify the argument using the strip $S$.
A: Yes, this is true for arbitrary roots  of $f$ and $g$; and more generally, if $\operatorname{Re}(f^p)\equiv \operatorname{Re}(g^p)$ for some constant $p\in\mathbb C$ with $\operatorname{Re}p>0$. 
Suppose first that neither of $f,g$ is identically zero. Write 
$$f(z)=z^m F(z), \quad g(z)=z^n G(z)$$ where $F(0)\ne 0$ and $G(0)\ne 0$. Let $\mathbb T=\{\zeta: |\zeta|=1\}$ be the unit circle. 
Introduce maps $\Phi,\Psi:\mathbb T\times \mathbb C\to \mathbb C$   by $$\Phi(\zeta,z) = \zeta^m F(z), \quad 
\Psi(\zeta,z) = \zeta^n G(z)$$
They are continuous. Pick $\zeta_0\in\mathbb T$ so that neither $\Phi(\zeta_0,0)$ nor $\Psi(\zeta_0,0) $ lie   in $(-\infty,0]$; this is possible because there are only finitely many "bad" points of $\mathbb T$ to avoid. Since the set $(-\infty,0]  $ is closed in $\mathbb C$, there is a neighborhood of $(\zeta_0,0)$ in $\mathbb T\times \mathbb C$ in which neither $\Phi$ nor $\Psi$  take values in $(-\infty, 0]$. 
Translating the above paragraph into a statement about $f$ and $g$, we conclude that there is a sector $$S=\{ \zeta_0  z : 0<|z|<r, |\arg z|<\theta \}$$
in which neither $f$ nor $g$ take values in $(-\infty, 0]$. The functions $f^p$ and $g^p$ are holomorphic in $S$. Since they have the same real part, their difference is a purely imaginary constant. As $z\to 0$, we have  $ f(z)^p\to 0$ and $ g(z)^p\to 0$. Thus, the purely imaginary constant is $0$. Since $f\equiv g$ in $S$, by the identity theorem $f\equiv g$ in $D$. $\quad\Box$ 
If one of two functions $f,g$ is identically zero, we can still construct a sector $S$ for the other function. Then argue as above that this function is constant, and that the constant is $0$.
