I want to prove that if $f(\mathbb{R}) = \mathbb{R}$ then $f(z) = \overline{f(\bar z)}$ for an entire function $f$.
My idea was using the identity theorem. If $f(\mathbb{R}) = \mathbb{R}$ then: $$\forall z \in \mathbb{R}: f(z) = f(\bar z) = \overline{f (\bar z)}$$ I only just learned about the identity theorem, so I wanted to ask whether this is indeed a valid application of it.
Yes, it is, after you have proved that the function $z\mapsto\overline{f\left(\overline z\right)}$ is an analytic function.