If $ \int\limits_\gamma f(z)dz\in\Bbb R$ does it imply $ f(z)\in \Bbb R~\forall z\in\gamma$ ?

This is from a proof where $ \gamma$ is a circle and we have $ 1={1\over 2\pi}\int\limits_\gamma f(z)dz={1\over 2\pi}\int\limits_\gamma Re~f(z)dz$ and I’m unsure how the second equality is justified.