Let z1,z2∈Ω be distinct. Since Ω is convex, the line γ:[0,1]→Ω, t↦tz1+(1−t)z2, is contained entirely within Ω.
Write f=u+iv, where u=Re(f) and v=Im(f). Since f is holomorphic, it satisfies the Cauchy-Riemann equations; in particular,
f′(z)=∂x∂f(x)=∂x∂u(z)+i∂x∂v(z).
Thus, by the fundamental theorem of calculus,
f(z1)−f(z2)=∫γf′(z)dz⟹Re(f(z1)−f(z2))=∫γ∂x∂f(z)dz=∫γ∂x∂u(z)+i∂x∂v(z)dz=∫γ∂x∂u(z)dz+i∫γ∂x∂v(z)dz=∫γ∂x∂u(z)dz>0.
Indeed, z1=z2, so γ has positive length, and ∂x∂u>0 and is continuous, so it is bounded below by some δ>0 on a small segment of γ with positive length. Hence, the real part of f(z1)−f(z2) never vanishes, so f(z1)=f(z2), so f is injective.
Consider Ω=C∖(−∞,0] and g(z)=z1/2, which is holomorphic on Ω since it is simply connected and avoids 0. Here, we choose the branch chosen such that g(x)>0 on (0,∞). Set f(z)=[g(z)]3 so that for z∈(0,∞),
f′(z)=23g(z).
This branch of g(z) maps to the right-half plane, and so Re(f′(z))>0, but f is not injective, e.g., f(1)=1, and
f(ei4π/3)=[g(ei4π/3)]3=1.