I want to integrate $f(z)=1/z$ over both the semi circle in the upper half of the plane and the lower half of the plane. I parameterised the first as $\gamma(t)=e^{it}, 0\leq t\leq \pi$ and the second as $\gamma_2(t)=e^{it}, -\pi \leq t \leq 0.$
I know that one should give me $i\pi$ and the other should give $-i\pi$. However, I'm getting $i\pi $ from both of them. Why is this?
In complex integration you need to be more clear with where your contours start and end; you have written $-\pi \le t \le 0$ but does this mean $t: 0 \to -\pi$ (clockwise from $z = +1$ to $z=-1$ via $-i$) or $t: -\pi \to 0$ (counterclockwise from $z = -1$ to $z = +1$ via $-i$).
Because $\int_a^b dx ~ f(x) = -\int_b^a dx ~ f(x) $ these will give you opposite answers.
If you are indeed going counterclockwise for both, then notice that this does give you $2\pi i$ as it must (e.g. because of the Residue Theorem) and anyone who tells you otherwise is a dirty liar.