Given the following one form $$\omega = \left(\frac{1}{x} + \frac{1}{y}\right)dx + \left(\frac{x}{y^2} + y\right)dy= \alpha(x,y)dx + \beta(x,y)dy$$ the task is to check whether an $f$ exists with $\omega=df$, i.e., if $\omega$ is exact. The $\mathbb{R}^2$ is however "pierced" since we have to take out $(0,0)$. Therefore, we should not be allowed to use the integrability condition $$\partial_y\alpha \stackrel{!}{=}\partial_x\beta\\ \frac{1}{y^2} = \frac{1}{y^2}$$ since we need the space to be simply connected to apply it. But let us ignore it and say "except for $(0,0)$ the integrability condition holds". Doing the integration one then finds $$f(x,y) = -\ln|x| - \frac{x}{y} + \frac{1}{2}y^2 + C$$ where $\omega=df$ except for $(0,0)$. Here I'm confused since I did not expect the $f$ to exist. The problem is obvious when choosing a circle around the origin $$\vec{r}(t)=R(\cos(t),\sin(t))^T$$ with $0 \leq t \leq 2\pi$. The integral over $\vec{r}^*\omega$ diverges. So what is this $f$ I calculated? Obviously not the scalar potential, or?
EDIT:
As peek-a-boo mentioned, one has to remove both the $x$ and the $y$-axis. This leads to four disjoined simply connected regions. In all four one can find a scalar field such that $\omega=d f$.
The issue appears because of the integrability condition. As you noticed your space is not simply connected so you can't directly apply it. What you can do is apply it to any closed path in $\mathbb{R}^2$ that does not include $0$. So you can get a solution on some simply connected subset of $\mathbb{R}^2 \setminus \{0\}$, say $\mathbb{R}^2$ minus some ray starting at zero but the function you find there will not extend to a continuous function on $\mathbb{R}^2 \setminus \{0\}$.