Let $f,g$ be holomorphic on a bounded domain $D$ and continuous on $\overline{D}$. Assume that $\Re(f)=\Re(g)\forall z\in\partial D$. Prove that $\Re (f-g)=0$.
My attempt
Consider $h=f-g$. Clearly $h$ is holomorphic on $D$, continuous on $\overline{D}$.
If $h$ is constant, then we finish.
If $h$ is non-constant. According to Maximum modulus principle, for all $z\in\overline{D}$, we have $$|h(z)|\leq|h(z_0)|\quad (\text{ for some }z_0\in\partial D).$$
which also means that $$\sqrt{\Re^2(f(z)-g(z))+\Im^2(f(z)-g(z))}\leq\sqrt{\Im^2(f(z_0)-g(z_0))}$$
Hence we obtain the following inequality $$\Re^2(f(z)-g(z))+\Im^2(f(z)-g(z))\leq\Im^2(f(z_0)-g(z_0))^2\quad\forall z\in\overline{D}.$$
I'm stuck at here. Could someone help me to continue or another way to deal with the problem? Thanks in advance!