Fundamental Theorem of Calculus when the integrand is logarithmic derivative Let $f(z)$ be an entire function and let $C$ be a broken line segment from $2$ to $2+2i$ to $1+2i$, and given that $f(z)$ is non zero on $C$.
Fundamental theorem of Calculus(FToC): If a continuous function $f$ has a primitive $F$ in $\Omega$, and $\gamma$ is a curve in $\Omega$ that begins at $w_{1}$ and ends at $w_{2}$, then $\int_{\gamma}f(z)dz = F(w_{2}) - F(w_{1})$
Question: How by the fundamental theorem of Calculus we have $$\Im\left(\int_{C} \frac{f'(z)}{f(z)}dz\right)=\Im\left(\log\left(f\left(1+2i\right)\right)\right)$$
where $\Im$ denotes the imaginary part and $f(z)$ is non zero on $C$.
Since $f(z)$ is entire and non zero on $C$ but then $f(z)$ might be $0$ in some domain containing curve $C$. Then how FToC applies here? Do we require parametrizing the segment?
Edit If we consider $f(z)=\left(z-(\frac{1}{4}+i)\right)\left(z-(\frac{3}{4}+i)\right)\left(z-(\frac{1}{4}-i)\right)\left(z-(\frac{3}{4}-i)\right)$.
Consider a rectangle $R=\{x+
iy\in\mathbb{C}\mid 0\leq x\leq 1, 0\leq y\leq 2\}$ and $\#Z$ be the no. of zeros of $f$ inside $R$. By Argument principle on $R$,   $$\#Z= \frac{1}{2\pi i}\int_{\partial R} \frac{f'(z)}{f(z)}dz=2\tag{1}$$
Since $f(z)=f(1-z)$ so $$\#Z= \frac{1}{\pi}\Im\left(\int_{L} \frac{f'(z)}{f(z)}dz\right)\tag{2}$$
where $L: 1\to 1+2i\to \frac
{1}{2}+2i$. By FToC, $(2)$ becomes $$\#Z= \frac{1}{\pi}\Im\left(\int_{L} \frac{f'(z)}{f(z)}dz\right)=\frac{1}{\pi}\Im\left(\log\left(f\left(\frac{1}{2}+2i\right)\right)\right)\tag{3}=0$$
Why $(1)$ and $(3)$ contradict each other?
 A: Since $f$ is entire (i.e. also continuous) and $f(z) \neq 0$ on $C$, we can for each point $z'\in C$ find a small neighbourhood $U(z')$ so that $f(z) \neq 0$ $\forall z\in U(z')$. So basically we can find an open set $U := \bigcup\limits_{z'\in C} U(z')$, so that $C \subset U$ and $f(z)\neq 0$ for every $z\in U$.
This domain is simply connected, so each holomorphic function on $U$ has a primitive (theorem of Morera).  This includes $\frac{f'}{f}$, so it has a primitive and is thus subject to the fundamental theorem.
Edit Regarding your edit.
As long as the domain $D$ is simply connected, we have a primitive. Note that this is a topological obstruction, not something that comes from the function.
The basic problem is that the complex logarithm is not globally defined as a function because it has different branches: For each $n\in\mathbb{Z}$, there is a possible complex logarithm $\operatorname{Log} : (0,\infty)\times [-\pi,\pi)\rightarrow\mathbb{C}$, which maps $z = |z|\cdot e^{i\varphi}$ to $\log|z|+i\cdot(\varphi+n2\pi)$ (here $\log$ means the standard real logarithm function).
So whenever the argument of the complex number $f(z)$ inside of $\operatorname{Log}(f(z))$ leaves $(n\pi,(n+2)\pi)$, there occurs a "jump" with height $2\pi i$. That's why, for example, the integral of $f(z) = \frac{1}{z}$ does not vanish on $\partial B_1(0)$.
Maybe you already knew all of this, but that's basically where your "contradiction" comes from: While integrating along $\partial R$, the primitive of $f'/f$ changes twice by $2\pi i$.
You can calculate this explicitely by splitting $\partial R$ into separate curves and then use the fundamental theorem on each of those.
Edit 2
Maybe I should have just said that it is very important that we keep an eye on the argument of $f(z)$, as we integrate over the curve $\partial R$. Lets write $\partial R = L \cup L' \cup [0,1]$, where $L'$ is just your L-shaped curve $L$ reflected along the line $\Re (z) = 1/2$.
Let's say we parametrize $L$ via $L(t), t\in[0,1]$, then $$f(L(0)) = f(1) = 425/256, \text{ and}$$
$$f(L(1)) = f(1/2+2i) = 2465/256$$
Both values are real, however the argument of $f$ has already changed by $2\pi$ (as can be seen in the picture: This is the red part), which we can see by comparing $\Im(f(L(t))$ for values of $t$ close to $0$ (where it is positive) and close to $1$ (where it is negative).
This means that when calculating the integral, we get $$\Im\int\limits_L \frac{f'}{f}dz = \Im(\operatorname{Log}(f(1/2+2i))-\operatorname{Log}(f(1)) )= \Im(... + 2\pi i) = 2\pi$$
Now as you already mentioned, due to its symmetry $f(z) = f(1-z)$, we get that $$\Im \int\limits_{L'} ... = \Im\int\limits_L ... = 2\pi,$$ this is the blue part in the picture (i.e. $f(L')$).
Finally, on the last piece of the curve, the part from $0$ to $1$ along the real axis, the imaginary part of $f$ is constantly zero, so the argument doesn't change (see the little black part of the curve in the picture) and thus: $$\Im\int\limits_{[0,1]} ... = 0$$
I think the picture says more than everything I've written though: You can clearly see that while walking along $f(\partial R)$, the argument changes two times in the same direction by $2\pi$.
$f(\partial R)$" />
