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.