I was trying to solve the integral $\int \frac{\ln x}{1+x^2}dx$.
using the sub $u=\frac{1}{x}$ which means $x= \frac{1}{u}$ and $dx=\frac{-du}{u^2}$, so the integral becomes
$$\int \frac{\ln\frac{1}{u}}{1+\frac{1}{u^2}}\frac{-du}{u^2}$$$$=\int \frac{\ln u}{1+u^2}du$$
At first, I thought that I just got back to where I started because both integrals seemed to be equally challenging. However I remembered that if I was to find the anti-derivative $F$ then $\int\frac{\ln x}{1+x^2}dx~=~F(x)~+~c$ but at the same time $\int\frac{\ln u}{1+u^2}du~=~F(u)$, and since $u=\frac{1}{x}$ then $F(u)=F(\frac{1}{x})$, which seems like a contradiction. Then, it looked like both integrals are equal but when we find the anti-derivative and substitute back to x the two integrals are no longer equal!
There's no contradiction here---any antiderivative indeed satisfies the functional equation $$F\left(\frac1x\right) = F(x),$$ but as you've observed, the substitution $u := \frac{1}{x}$ isn't particularly helpful for evaluating the indefinite integral.
Instead applying integration by parts with $v = \log x$, $dw = \frac{dx}{1 + x^2}$ gives $$\int \frac{\log x}{1 + x^2} \,dx = \arctan x \log x - \int \frac{\arctan x}{x} \,dx,$$ and the integral on the right-hand side cannot be expressed in closed form in terms of elementary functions, but it can be evaluated using a standard power series technique, giving the general antiderivative $$F(x) := \int \frac{\log x}{1 + x^2} \,dx = \arctan x \log x + \frac{i}{2} [\operatorname{Li}_2(ix) - \operatorname{Li}_2(-ix)] + C .$$ Despite the appearance of the imaginary constant $i$, $F(x)$ takes on real values for $x > 0$.
On the other hand, taking the limit of the functional identity shows that $$\lim_{x \searrow 0} F(x) = \lim_{x \to \infty} F(x) ,$$ giving the particular value $$\int_0^\infty \frac{\log x}{1 + x^2} \,dx = 0,$$ the computation of which is the content of the original problem o.p. mentioned in the comments. A standard power series argument gives the particular value $$\int_0^1 \frac{\log x}{1 + x^2} \,dx = -G ,$$ where $G := \sum_{n = 0}^\infty \frac{(-1)^n}{(2 n + 1)^2} = 1 - \frac{1}{9} + \frac{1}{25} - \frac{1}{49} + \cdots$ is Catalan's constant.