Given analytic function $f(z)$ on $\mathbb{H}:=\{x>0\}$ satisfying $$0\leq \Re{f(z)}\leq M\Re{z}$$ for some $M>0$ and $z \in \mathbb{H}$ I want to show that $f$ takes form $$f(z)=mz+ic$$ where $m\in[0,M],c\in\mathbb{R}$.
[Observation] If $f$ can be extended to $\partial{\mathbb{H}}$, then the condition implies that $f$ must takes purely imaginary number on $\{x=0\}$. By proper rotation we can extend $f$ to the whole plane by Reflection Principle and thus the entire function $e^{f(z)}$ have at most growth order of 1, whence by Hadamard's factorization theorem with some detailed argument we get the conclusion. Here's the only obstacle that left within the argument:
Can $f(z)$ be continuously extended to the boundary $\{x=0\}$ from the assumptions?