So I tried to understand complex analysis better, but I stumbled on this problem. I'm certain that a primitive (anti-derivative) of the function $z\mapsto \bar{z}$ doesn't exist, since the integral on the unit circle doesn't vanish (I hope that this is correct, anyway). However, someone gave me this "proof":
$$\int \bar{z} ~dz=\int \overline{Re(z)+i\cdot Im(z)}~dz=\int Re(z)-i\cdot Im(z)~dz=\int Re(z)~dz-i\int Im(z)~dz$$ $$=Re\int z~dz-i\cdot Im\int z~dz=\overline{Re\int z~dz+i\cdot Im\int z~dz}=\overline{\int z~dz}.$$
Since $z$ has primitive $z^2/2+C$ (for some constant $C$), we would get a primitive for $\overline{z}$, which doesn't make sense. Where does this go wrong? Thanks in advance!
This is wrong: $$ \int_\gamma \operatorname{Re}(z) \, dz = \operatorname{Re} \left( \int_\gamma z \, dz\right) $$ and also the same with the imaginary parts. Generally, for a curve $\gamma:[a, b] \to D \subset \Bbb C$ and a continuous function $f: D \to \Bbb C$, $$ \operatorname{Re} \left( \int_\gamma f(z) \, dz\right) = \operatorname{Re} \left( \int_a^b f(\gamma(z))\cdot \gamma'(t) \, dt \right) = \int_a^b \operatorname{Re}\left(f(\gamma(z)) \cdot \gamma'(t)\right) \, dt $$ and $$ \int_\gamma \operatorname{Re} (f(z)) \, dz = \int_a^b \operatorname{Re}\bigl(f(\gamma(z))\bigr) \cdot \gamma'(t) \, dt $$ and these expressions are not equal in general.
In our case, since $\bar z = 1/z$ on the unit circle, $$ \int_\gamma \bar{z} \, dz = \int_\gamma \frac 1z \, dz = 2 \pi i \ne 0. $$