I try to solve this problem by using Liouville's theorem but I could not find any way to prove that $f$ is bounded.
Edit: I have noticed that my question seems like a duplicate of the question "An entire function which has a bounded real part is constant". Well, the major difference here is that while the other question works with the real part of the function, my question is dealing with the real part of z itself. So unless we can prove that Re($f(z)$) is equivalent to Re($z$) (which will never happen), these two question are completely different from each other.
Another edit (after being enlightened): Mine is a duplicate of this problem. An entire function whose real part is bounded must be constant.