Answer
$$ f(x,y,z)=x^2+y+2z+K $$
Work Step by Step
Given $$\nabla f=\langle 2x, 1,2\rangle$$
Since $$ \nabla f=\left\langle\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right\rangle=\langle2x,1,2\rangle$$
Then
\begin{align*}
\frac{\partial f}{\partial x}&=2x\ \ \ \Rightarrow\ \ f=x^2+C_1\\
\frac{\partial f}{\partial y}&=1\ \ \ \Rightarrow\ \ f= y+C_2\\
\frac{\partial f}{\partial z}&=2\ \ \ \Rightarrow\ \ f=2z+C_3\\
\end{align*}
Hence
$$ f(x,y,z)=x^2+y+2z+K $$