Functional equation $ f(x) + f\left(1-\frac{1}{x}\right) = \tan^{-1}(x) $ and definite integral

Let $g(x)=1-\frac1x$. Then $g(g(x))=\frac1{1-x}$ and $g(g(g(x)))=x$.

Thus, $$ f(x)+f(g(x))=\tan^{-1}(x)\tag1 $$ $$ f(g(x))+f(g(g(x)))=\tan^{-1}(g(x))\tag2 $$ $$ f(g(g(x)))+f(x)=\tan^{-1}(g(g(x)))\tag3 $$ Since $2f(x)=(1)-(2)+(3)$, we get $$ f(x)=\frac12\left(\tan^{-1}(x)-\tan^{-1}(g(x))+\tan^{-1}(g(g(x)))\right)\tag4 $$ As mentioned in comments, this function is not continuous:

enter image description here

What is interesting is that the derivative of this function is continuous (if we subtract $\frac\pi2$ from $f$ in $[0,1]$ to counter the jump discontinuities):

enter image description here

In any case, $$ \begin{align} &\int_0^1f(x)\,\mathrm{d}x\\ &=\frac12\left(\int_0^1\tan^{-1}(x)\,\mathrm{d}x-\int_0^1\tan^{-1}(g(x))\,\mathrm{d}x+\int_0^1\tan^{-1}(g(g(x)))\,\mathrm{d}x\right)\tag5\\ &=\frac12\left(\int_0^1\tan^{-1}(x)\,\mathrm{d}x-\int_{-\infty}^0\tan^{-1}(x)\,\mathrm{d}g(g(x))+\int_1^\infty\tan^{-1}(x)\,\mathrm{d}g(x)\right)\tag6\\ &=\scriptsize\frac12\left(\frac\pi4-\color{#C00}{\int_0^1\frac{x}{1+x^2}\,\mathrm{d}x}+\color{#090}{\int_{-\infty}^0\frac1{(1-x)\left(1+x^2\right)}\,\mathrm{d}x}+\frac\pi2-\color{#00F}{\int_1^\infty\frac{x-1}{x\left(1+x^2\right)}\,\mathrm{d}x}\right)\tag7\\ &=\frac12\left(\frac\pi4-\color{#C00}{\frac{\log(2)}2} +\color{#090}{\frac\pi4} +\frac\pi2-\color{#00F}{\frac{\pi-2\log(2)}4}\right)\tag8\\[3pt] &=\frac{3\pi}8\tag9 \end{align} $$ Explanation:
$(5)$: apply $(4)$
$(6)$: apply $g$ and $g\circ g$ to get $\tan^{-1}(x)$ in each integral
$(7)$: integrate by parts
$(8)$: evaluate the integrals by partial fractions
$(9)$: simplify


To long for a comment. (I'm afraid if my calculation be a little wrong. I'm in a hurry situation, sorry)

By your notations, we have $$2I=\frac{\pi}{2}-\int_0^1f(\frac{1}{x})dx-\int_0^1f(1-\frac{1}{x})dx.$$ Take $\dfrac{1}{u}=1-\dfrac{1}{x}$, we have $x=\dfrac{u}{u-1}$, $dx=-\dfrac{du}{(u-1)^2}$ and $$\int_0^1f(1-\frac{1}{x})dx=-\int_0^\infty\frac{f(1/u)}{(u-1)^2}du$$ On the other hand, by letting $x=\dfrac{1}{u}$, we have $$\int_0^1f(\frac{1}{x})dx=\int_1^\infty\frac{f(u)}{u^2}du=\int_0^\infty \frac{f(u-1)}{(u-1)^2}du.$$