The problem is in the subject line, I have it for homework. $f$ is a complex valued function. For completeness:
Prove that if $f$ is an entire function and for some rectangle $R$, the image $f(R)$ is also a rectangle, then $f$ is linear.
The composition of linear maps is linear, so we can choose the two rectangles to have two edges coinciding with the real and imaginary axes, and their common vertex at the origin. So as a portion of the real line gets mapped to itself, we can take $f$ to be the analytic continuation of a real function. Then I'm stuck.
This question is confusing me. It's well known from the Riemann mapping theorem that there exists many holomorphic functions taking any rectangle to any other given rectangle. But if $f$ is linear, then the two rectangles must be similar. So the added restraint of $f$ being entire seems to be causing this hassle. Thoughts?