Is it possible for a function $f(x,y)$ satisfying $\nabla f=y\mathbf{i}-x\mathbf{j}$ ?
Since $\frac{\partial^2 f}{\partial x \partial y}=-1$ and $\frac{\partial^2 f}{\partial y \partial x}=1$, thus $f$ should be singular.
I find a similar answer in wikipedia "Symmetry of Second derivatives",
$f(x,y)=\frac{xy(x^2-y^2)}{x^2+y^2}$ for $(x,y)\ne(0,0)$ and $f(x,y)=0$ for $(x,y)=(0,0)$, however, this function just satisfies at $(x,y)=(0,0)$.
Does anybody know a function satisfies the condition in the whole variables domain?
It's impossible. The necessary an sufficient condition for the local existence of $f$ s.t. $\nabla f = \bf F$ for a given vector field $\bf F$ is $\partial_i F_j = \partial_j F_i$ (Poincaré's Lemma).