If in ${\mathbb R}^3$,
$r=\sqrt{x^2+y^2+z^2}\text{ and }\vec{P}= \dfrac{\partial}{\partial z} \left( \dfrac{1}{r} \right) (\hat{j}) -\dfrac{\partial}{\partial y} \left( \dfrac{1}{r} \right) (\hat{k})$
how can we show that $\vec{\nabla} \cdot \vec{P}=0$ over the whole domain of ${\mathbb R}^3$?
Edit in response to the answer
It is said in the answer that "The problem is that the field $f=1/r$ itself is not even defined at the origin, so its derivatives are not going to be defined either".
With this information, is it correct to say that $\vec{P}=\nabla \times \vec{A}$ everywhere except the origin. Why? Why not?
The problem is that the field $f = 1/r$ itself is not even defined at the origin, so its derivatives are not going to be defined either. That being said you could define the field
$$ f_a = \frac{1}{r + a} \tag{1} $$
for some constant $a > 0$, and then calculate ${\bf P}_a$ as
$$ {\bf P}_a = \frac{\partial}{\partial z}f_a ~\hat{y} - \frac{\partial}{\partial y}f_a ~\hat{z} \tag{2} $$
so that
$$ \nabla \cdot {\bf P}_a = \frac{\partial^2 }{\partial y\partial z}f_a - \frac{\partial^2 }{\partial z\partial y}f_a \tag{3} $$
since $f_a$ has continuous derivatives, you can switch the order, therefore
$$ \nabla \cdot {\bf P}_a = 0 \tag{4} $$
Now take the limit
$$ \nabla \cdot {\bf P} = \lim_{a\to 0}\nabla \cdot {\bf P}_a = 0 $$