I have to prove that $\int_0^\pi \frac{dz}{3+z^2} \leq \frac\pi3$ I wanted to prove it by directly getting the integral value
I know $$\int_0^\pi \frac{dz}{3+z^2} = \int_0^\pi \frac{dz}{z^2-(\sqrt{3i})^2} = \int_0^\pi \frac{dz}{(z-\sqrt{3i})(z+\sqrt{3i})} $$
making $$t=\sqrt{3i} = \sqrt{3}e^{\frac{i\pi}{4}} = {\frac{\sqrt{6}}{2}}(1+i)$$
and using partial fractions we get
$${\frac{1}{(z+t)(z-t)}} = \frac{A}{(z+t)} + {\frac{B}{(z-t)}}$$ \
$$1 = A(z-t) + B(z+t)$$
with solutions
$$A=\frac{-1}{2t}$$ and $$ B=\frac{1}{2t} $$
substituting for t
$$A=\frac{-1}{2t} = \frac{-1}{2\frac{\sqrt{6}}{2}(1+i)}= \frac{-1}{2\sqrt{6}}(1-i) $$
therefore
$$B= \frac{1}{2\sqrt{6}}(1-i) $$
finally we get that
$$\int_0^\pi \frac{dz}{3+z^2} = \frac{1}{2\sqrt{6}} \Biggl( \int_0^\pi \frac{1-i}{z+\sqrt{3i}} - \int_0^\pi \frac{1-i}{z-\sqrt{3i}} \Biggl)$$ \
here is where I get confused I was hinted on using Cauchy Goursat but I am not sure why I can use this at this point or how to proceed from this point onwards. I mean I know going from 0 to $\pi$ and then from $\pi$ to 0 would be a closed path but it's not even the same integral so I am not sure how to continue.
We have a subtle caveat with your question. The inequality
$$\int_{0}^{\pi} \frac{dz}{z^2 + 3} \leq \frac{\pi}{3}$$
indicates that
$$\int_{0}^{\pi} \frac{dz}{z^2 + 3} \in \mathbb{R}$$
otherwise an ordering can not be defined between the integral and $\pi/3$ because $\mathbb{C}$ is not an ordered field. In this case, you do not even have to evaluate this integral at all in the complex setting.
We have the well known formula
$$\int_{a}^{b} \frac{dx}{x^2 + 1} = \arctan b - \arctan a$$
With $x = \sqrt{3} z/3$, you can proceed from here without using techniques from complex analysis like the Cauchy-Goursat's theorem. Wouldn't this be sufficient for your needs?
Or was there supposed to be some modulus operator $\mid \cdot \mid$ in the integral?