$|f|$ constant implies $f$ constant? If $f$ is an analytic function on a domain $D$ and $|f|=C$ is constant on $D$ why does this imply that $f$ is constant on $D$? Why is the codomain of $f$ not the circle of radius $\sqrt{C}$?

It follows from that a non-constant analytic function on a domain (domain meaning open, connected subset) is an open map. The circle of radius C doesn't contain any open sets at all, so it can't possibly contain the image of a domain under an analytic map. 
It's quite a powerful result, and relies on both analyticity and mapping from an open, connected set. It's a special case of the maximum modulus principle, really.
Examples where this fails due to losing hypotheses: if you take the map that maps two disjoint discs to different points on the same circle (e.g. the ball of radius 1 around -2 to 1, ball of radius 1 around 1 to -1), that's analytic, with $|f|$ constant but $f$ not constant. Or if you just have the inclusion map, and map the closed interval [0,1] to some part of the unit circle, it fails again as you're not mapping from an open set. Examples where it's not analytic are easy (e.g. rational coordinates map to 1, coordinates with an irrational in them map to -1)
