Answer
We can express $F(x)$, the most general antiderivative of $g(x)$, as follows:
$F(x) = ln~x +arctan~x + C_1~~~~~~~~$ if $x \gt 0$
$F(x) = ln~(-x) +arctan~x + C_2~~~~$ if $x \lt 0$
Work Step by Step
We can find the most general antiderivative of the function:
$\int~g(x)$
$= \int (\frac{1}{x}+\frac{1}{x^2+1})$
$= \int \frac{1}{x}+\int \frac{1}{x^2+1}$
$ = ln~\vert x \vert +arctan~x$
Since $\frac{d}{dx}(ln~\vert x \vert) = \frac{1}{x}$ for all $x$ such that $x \neq 0$, then $ln ~\vert x \vert$ is an antiderivative of $\frac{1}{x}$.
However, since $ln~\vert x \vert$ is not defined for $x=0$, we can express $F(x)$, the most general antiderivative of $g(x)$, as follows:
$F(x) = ln~x +arctan~x + C_1~~~~~~~~$ if $x \gt 0$
$F(x) = ln~(-x) +arctan~x + C_2~~~~$ if $x \lt 0$