if f is analytic in a domain D and f is real valued on D then f is constant on D :
proof :
im z =0 on D
It follows immediatly from the fact that every non constant analytic function f on a domain D is an open mapping. Assume f not to be constant and you will get an easy contradiction using this fact.