Let $f(x,y) = u+iv = x^2-y^2 + 2ixy$.
Then
$$\bar{f}(z,y) = x^2 - y ^2 -2ixy$$ $$u(x,y)=x^2-y^2$$ $$v(x,y)=2xy$$
The given function represents a locally sourceless and irrotational flow since $\bar{f}$ is analytic on $\mathbb{C}$.
However, $f$ is neither globally sourceless nor globally irrotational.
$$\frac{\partial{v}}{\partial{x}} = 2y$$ $$\frac{\partial{u}}{\partial{y}} = -2y$$ $$\frac{\partial{v}}{\partial{x}} - \frac{\partial{u}}{\partial{y}} = 4y$$
This shows that $f$ is not globally irrotational.
$$\frac{\partial{u}}{\partial{x}} = 2x$$ $$\frac{\partial{v}}{\partial{y}} = 2x$$ $$\frac{\partial{u}}{\partial{x}} + \frac{\partial{v}}{\partial{y}} = 4x$$
This shows that $f$ is not globally sourceless.