It isn't too hard to show that if $f:\mathbb{C}\to\mathbb{C}$ holomorphic everywhere (entire) and $\Re (f)$ is bounded, then $f$ is constant: it suffices to consider $\exp f$, which is entire, and by $|\exp f|=\exp\Re (f)$ bounded and therefore constant. That question has been asked on this site before.
I am now asked to show that this holds if $f$ is only defined on $U\subseteq\mathbb{C}$, $U$ path-connected and non empty, and the bound is attained in the interior of $U$. Because of the domain I can't use Liouville anymore, so I am not sure how to proceed.
Is it true that there exists a differentiable bijection $\phi: U\to\mathbb{C}$ for instance? That would resolve the issue... Otherwise some help would be welcome.
I think that the result is not true.
For example, if $U$ is the unit open disk centered at the origin, and $f(z)=\exp(z)$, then we have that $\exp(z)=\exp(x)\cos(y)+i\exp(x)\sin(y)$, for $z=x+iy$. We have that the absolute value of the real part, $|\exp(x)\cos(y)|$ is bounded by $\exp(1)$ for all $z\in U$, but we know that $\exp(z)$ is not constant in $U$.
If the bound is attained in the interior of $U$, the you can use the Maximum modulus principle as Sangchul Lee says.