Are we to assume that X is a single real number and "grad" is just the derivative?
If that is the case, the, for x< 0, x/|x|^3= -1/x^2 and the integral is 1/x. If x> 0, x/|x|^3= 1/x^2 and the integral is -1/x.
If, however, X is the vector <x, y, z>, then the problem is not at all the same!
You are looking for a function U(x,y,z) such that
\left<\frac{\partial U}{\partial x}, \frac{\partial U}{\partial y}, \frac{\partial U}{\partial z}\right>= \left<\frac{x}{(x^2+ y^2+ z^2)^{3/2}}, \frac{y}{(x^2+ y^2+ z^2)^{3/2}}, \frac{z}{(x^2+ y^2+ z^2)^{3/2}}\right>
And that's not terribly difficult.
To integrate
\frac{\partial U}{\partial x}= x(x^2+ y^2+ z^2}^{-3/2}
with respect to x, let W= x^2+ y^2+ z^2. Then, treating y and z as constants, dW= 2xdx and we have to integrate
\frac{1}{2}\int W^{-3/2}dW= -W^{-1/2}+ \phi(y,z)= -(x^2+ y^2+ z^2)^{-1/2}+ \phi(y,z)
(Since the integration is done treating y and z as constant, the "constant of integration" may depend on y and z.)
Now, differentiate that with respect to y:
(1/2)(x^2+ y^2+ z^2)^{-1/2}(2y)+ \phi_y= \frac{y}{\sqrt{x^2+ y^2+ z^2}}+ \phi_y
Comparing that with the gradient, we see that \phi_y= 0 and so does not depend on y. Doing the same with z shows that \phi_z= 0 also and so it reallyis a constant.