Very simple partial differential equation I am solving
$$ \frac {\partial f}{\partial x} = \frac y{x^2 + y^2} \\ \frac {\partial f}{\partial y} = \frac {-x}{x^2 +y^2} $$
As $y$ was held constant when the partial derivative with respect to $x$ was obtained, we hold  $y$ constant and integrate the first equation. Then we obtain
$$f(x,y) = \arctan \frac xy + g(y)$$
We can now differentiate with respect to $y$ and obtain 
$$\frac {\partial f}{\partial y} = \frac {-x}{x^2 + y^2} + g'(y)$$
If we equate this to the second initial equation, we can conclude $g(y) = C$. A similar approach beginning with the second initial equation we get $f(x,y) = - \arctan \frac yx + K$. So we basically have
$$ f(x,y) = \arctan \frac xy + C \\ f(x,y) = - \arctan \frac yx + K $$
But now what? We got an ambiguous result, so which one is it going to be?
 A: Yes, the result is ambigous and there is no way around the ambiguity. I will try to explain.  
First, let us  solve this system of equations. Their appearance suggest using  polar coordinates, $x=r\cos\theta,$ $y=r\sin\theta.$ Then by the chain rule, $f_r=f_x x_r+f_y y_r=0,$ $f_\theta=f_x x_\theta+f_y y_\theta=1,$ hence $f=\theta + const.$.
Now the function $\theta$ (hence $\theta + const.$, for whatever value of $const.$) cannot be defined in the whole of the $x,y$ plane in a continous manner, even if you exclude the origin. If you define it in the usual manner, by measuring counterclockwise starting in the direction of the positive  $x$-axis, you get a discontinous jump of $2\pi$ accross the positive  $x$-axis. So in this manner it is defined, continously and differentiably, only on the complement in the $x,y$ plane of the non-negative $x$-axis. 
In general, it can defined in a small enough neighborhood of any point except the origin, but you can then extend it only to a region  which does not "surround" the origin. This is defined more precisly in a topology course but I hope it is intuitively clear. 

This problem is a special case of a much more general phenomena. Let $U\subset\mathbb R^2$ be some open set and $a,b:U\to\mathbb R$ some smooth functions. Let us try to find an $f:U\to \mathbb R$ such that $f_x=a, f_y=b$. An obvious  necessary condition for solving the system  is that $a,b$ satisfy $a_y=b_x$ (this comes from the identity $f_{xy}=f_{yx}$). In your case, $U$ is the complement of the origin, and $a,b$ satisfy the necessary condition. This condition is also sufficient  $locally$, i.e. a solution exists, and is unique up to a constant, in a small enough neighborhood of any point in $U$. But in general, depending on $U$ and $(a,b)$, the condition is not sufficient. A sufficient topological condition on $U$ (regardless of $a,b$) is that it is simply-connected (no "holes", unlike your $U$). But this is not necessary. A necesary and sufficient  condition is that the line integral of $adx + bdy$ along any closed curve in $U$ should vanish. In your case the line integral of $adx+bdy$ around the origin (counterclockwise) is $2\pi$, which is why you cannot solve the equations in all of $U$. 
In fancy topological language this is summed up as follows: a necessary condition for the  1-form $adx+bdy$ 
to be exact is that it is closed, and a sufficient condition for a closed form to be exact is the vanishing of  its periods along all non-trivial cycles in $U$. 
A: The way I would approach this problem would be to use the method of characteristics.
Parametrize a curve by $t$ and use the chain rule to compute
$$
\frac{\mathrm{d}f}{\mathrm{d}t}=\frac{\partial f}{\partial x}\frac{\mathrm{d}x}{\mathrm{d}t}+\frac{\partial f}{\partial y}\frac{\mathrm{d}y}{\mathrm{d}t}\tag{1}
$$
On a characteristic curve, we would like $f$ to remain constant. That is,
$$
\frac{\partial f}{\partial x}\frac{\mathrm{d}x}{\mathrm{d}t}+\frac{\partial f}{\partial y}\frac{\mathrm{d}y}{\mathrm{d}t}=0\tag{2}
$$
or
$$
\begin{align}
\frac{\mathrm{d}y}{\mathrm{d}x}
&=-\frac{\hphantom{\,}\frac{\partial f}{\partial x}\hphantom{\,}}{\frac{\partial f}{\partial y}}\\
&=\frac yx\tag{3}
\end{align}
$$
Separating variables in $(3)$, we get that the characteristic curves are
$$
y=kx\tag{4}
$$
that is, $f(x,y)$ is a function of $k=y/x$.
Let's solve the equation along the line $x=1$. The equation becomes
$$
\frac{\mathrm{d}f}{\mathrm{d}y}=-\frac1{1+y^2}\tag{5}
$$
Again separating variables gives
$$
f(1,y)=C-\tan^{-1}(y)\tag{6}
$$
and combining $(6)$ with the information from $(4)$, we get
$$
f(x,y)=C-\tan^{-1}(y/x)\tag{7}
$$
