Answer
$f\left( {x,y,z} \right) = xz + {y^2} + c$,
where $c$ is a constant.
Work Step by Step
We are given $\nabla f = \left( {z,2y,x} \right)$.
Write $\nabla f = \left( {{f_x},{f_y},{f_z}} \right) = \left( {z,2y,x} \right)$. So, we have
(1) ${\ \ \ }$ ${f_x} = z$
(2) ${\ \ \ }$ ${f_y} = 2y$
(3) ${\ \ \ }$ ${f_z} = x$
Integrating equation (1) with respect to $x$ we get
(4) ${\ \ \ }$ $f\left( {x,y,z} \right) = xz + g\left( {y,z} \right)$,
where $g$ is a function of $y$ and $z$.
Differentiating $f\left( {x,y,z} \right)$ with respect to $y$ and compare with equation (2) gives
${f_y} = {g_y} = 2y$
Integrating ${g_y}$ with respect to $y$ we get
$g\left( {y,z} \right) = {y^2} + h\left( z \right)$,
where $h$ is a function of $z$ only.
Substituting $g\left( {y,z} \right)$ in equation (4) gives
(5) ${\ \ \ }$ $f\left( {x,y,z} \right) = xz + {y^2} + h\left( z \right)$
Differentiating equation (5) with respect to $z$ and compare with equation (3) gives
${f_z} = x + {h_z} = x$
So, we conclude that ${h_z} = 0$. Hence, $h\left( z \right) = c$, where $c$ is a constant.
Substituting $h\left( z \right)$ in equation (5) gives
$f\left( {x,y,z} \right) = xz + {y^2} + c$
where $c$ is a constant.
Thus, we found a function $f\left( {x,y,z} \right)$ such that $\nabla f = \left( {z,2y,x} \right)$.