Here we discuss two ways of tackling the integral using contour integral. I added Solution 1 to help you implement the hint suggested by the professor. However, I personally recommend you to jump directly to Solution 2.
Solution 1. Consider
$$ f(z) = \frac{\log z}{z^3 - 1}, $$
where $\log(\cdot)$ is the principal complex logarithm. Now we integrate $f$ along the boundary of the indented sector of opening $2\pi/3$:
Here, the radius of the larger arc $\Gamma_2$ (resp. smaller arc $\Gamma_1$) is $R$ (resp. $\epsilon$) and $0 < \epsilon < 1 < R$. Then it is easy to check that
$$ \left| \int_{\Gamma_1} f(z) \, \mathrm{d}z \right| \leq C \epsilon ( C + \log (1/\epsilon) )
\qquad\text{and}\qquad
\left| \int_{\Gamma_2} f(z) \, \mathrm{d}z \right| \leq \frac{C(C + \log R)}{R^2} $$
for $C = 2\pi/3$, and so, the integrals along these curves vanish as $\epsilon \to 0^+$ and $R \to \infty$. So by the residue theorem,
\begin{align*}
\int_{L_1} f(z) \, \mathrm{d}z + \int_{L_2} f(z) \, \mathrm{d}z + \int_{L_3} f(z) \, \mathrm{d}z + \int_{\gamma} f(z) \, \mathrm{d}z = o(1)
\end{align*}
as $\epsilon \to 0^+$ and $R\to\infty$. However, using the fact that $\omega = e^{2\pi i/3}$ is a simple pole of $f(z)$, the function $(z - \omega)f(z)$ is analytic at $z = \omega$. So
\begin{align*}
\lim_{\epsilon \to 0^+} \int_{\gamma} f(z) \, \mathrm{d}z
&= \lim_{\epsilon \to 0^+} i\int_{2\pi/3}^{-\pi/3} \epsilon e^{i\theta} f(\omega + \epsilon e^{i\theta}) \, \mathrm{d}\theta \tag{$z=\omega+\epsilon e^{i\theta}$} \\
&= -i \pi \lim_{z \to \omega} (z - \omega)f(z)
= -i \pi \mathop{\mathrm{Res}}_{z = \omega} f(z) \\
&= \frac{2\pi^2}{9} \omega.
\end{align*}
Moreover,
\begin{align*}
\int_{L_2} f(z) \, \mathrm{d}z
&= -\omega \int_{1+\epsilon}^{R} f(\omega x) \, \mathrm{d}x
= -\omega \int_{1+\epsilon}^{R} \left( f(x) + \frac{2\pi i}{3} \cdot \frac{1}{x^3 - 1} \right) \, \mathrm{d}x
\end{align*}
and likewise
\begin{align*}
\int_{L_3} f(z) \, \mathrm{d}z
= -\omega \int_{\epsilon}^{1-\epsilon} \left( f(x) + \frac{2\pi i}{3} \cdot \frac{1}{x^3 - 1} \right) \, \mathrm{d}x.
\end{align*}
Combining altogether and using that $f(z)$ is analytic at $z = 1$,
\begin{align*}
(1 - \omega) \int_{\epsilon}^{R} f(x) \, \mathrm{d}x
- \frac{2\pi i \omega}{3} \left( \int_{\epsilon}^{1-\epsilon} \frac{1}{x^3 - 1} \, \mathrm{d}x + \int_{1+\epsilon}^{R} \frac{1}{x^3 - 1} \, \mathrm{d}x \right)
+ \frac{2\pi^2}{9} \omega = o(1).
\end{align*}
Letting $\epsilon \to 0^+$ and $R \to \infty$,
\begin{align*}
(1 - \omega) \int_{0}^{\infty} f(x) \, \mathrm{d}x
- \frac{2\pi i \omega}{3} \left( \mathop{\mathrm{PV}}\! \int_{0}^{\infty} \frac{1}{x^3 - 1} \, \mathrm{d}x \right)
+ \frac{2\pi^2}{9} \omega = 0.
\end{align*}
By noting that
\begin{align*}
\mathop{\mathrm{PV}}\! \int_{0}^{\infty} \frac{1}{x^3 - 1} \, \mathrm{d}x
&=-\frac{\pi}{3\sqrt{3}},
\end{align*}
we end up with
\begin{align*}
\int_{0}^{\infty} f(x) \, \mathrm{d}x
= \frac{\omega}{1 - \omega} \left( -\frac{\pi}{3\sqrt{3}} \cdot \frac{2\pi i}{3}
- \frac{2\pi^2}{9} \right)
= \frac{4\pi^2}{27}.
\end{align*}
Solution 2. Here is a more elegant solution. Let $\operatorname{Log}$ denote the complex logarithm chosen so that its argument lies between $0$ and $2\pi$. (Note: Using the principal complex logarithm, this can be realized by $\operatorname{Log}(z) = i\pi + \log(-z)$.) Then consider
$$ g(z) = \frac{(\operatorname{Log}(z) - 2\pi i)\operatorname{Log}(z)}{z^3 - 1}. $$
Then it is not hard to see that, for $x > 0$,
\begin{align*}
g(x + i0^+) := \lim_{\epsilon \to 0^+} g(x + i\epsilon)
&= \frac{(\log x - 2\pi i)\log x}{x^3 - 1} \\
g(x - i0^+) := \lim_{\epsilon \to 0^+} g(x - i\epsilon)
&= \frac{(\log x + 2\pi i)\log x}{x^3 - 1}.
\end{align*}
So by using the keyhole contour,
$$ \int_{0}^{\infty} \bigl( g(x + i0^+) - g(x - i0^+) \bigr) \, \mathrm{d}x
= 2\pi i \biggl( \mathop{\mathrm{Res}}_{z=e^{2\pi i/3}} g(z) + \mathop{\mathrm{Res}}_{z=e^{4\pi i/3}} g(z) \biggr) $$
Now the left-hand side is
$$ (-4\pi i) \int_{0}^{\infty} \frac{\log x}{x^3 - 1} \, \mathrm{d}x $$
and the right-hand side is
$$ 2\pi i \biggl( \frac{\bigl(\frac{2\pi i}{3} - 2\pi i \bigr)\bigl( \frac{2\pi i}{3} \bigr)}{3 e^{4\pi i}} + \frac{\bigl(\frac{4\pi i}{3} - 2\pi i \bigr)\bigl( \frac{4\pi i}{3} \bigr)}{3 e^{8\pi i}} \biggr) = 2\pi i \left( -\frac{8\pi^2}{27} \right).$$
Therefore the answer is again $\frac{4\pi^2}{27}$.
Best Answer
Using a CAS, I did not get any result for $I$ or $J$ but the surprise came when I tried to compute $(I+iJ)$. The produced result is
$$I+i J=\frac{\text{csch}\left(\frac{\pi }{2}\right)-\text{sech}\left(\frac{\pi }{2}\right)}{4 e}\, K$$
$$K=e^{\pi } \pi -e \left(e \pi +2 i \sinh (\pi )\, \Gamma (-1+i) \,\, _1F_2\left(1;\frac{2-i}{2},\frac{3-i}{2};\frac{1}{4}\right)\right)$$
So, $$\Re(K)=\left(e^{\pi }-e^2\right) \pi-2e \sinh(\pi)\,\Re\Bigg[i \Gamma (-1+i) \, _1F_2\left(1;\frac{2-i}{2},\frac{3-i}{2};\frac{1}{4}\right) \Bigg]$$ $$\Im(K)=-2e \sinh(\pi)\,\Re\Bigg[i \Gamma (-1+i) \, _1F_2\left(1;\frac{2-i}{2},\frac{3-i}{2};\frac{1}{4}\right) \Bigg]$$
$$I=\int_0^\infty\frac{\cos(x+\ln{x})}{x^2+1}dx=\frac{\text{csch}\left(\frac{\pi }{2}\right)-\text{sech}\left(\frac{\pi }{2}\right)}{4 e}\,\Re(K)$$ $$J=\int_0^\infty\frac{\sin(x+\ln{x})}{x^2+1}dx=\frac{\text{csch}\left(\frac{\pi }{2}\right)-\text{sech}\left(\frac{\pi }{2}\right)}{4 e}\,\Im(K)$$