Trying to understand the Nabla Operator I'm trying to wrap my head around the following line done in my physics textbook:
$\vec\nabla f(r) = \begin{pmatrix}
f'(r) \frac{\partial r}{\partial x}\\ 
f'(r) \frac{\partial r}{\partial y}\\ 
f'(r) \frac{\partial r}{\partial z}
\end{pmatrix}$
Where $r$ represents the distance between the origin and some object (int three dimensional space). Therefore I could write it as $r = \sqrt{x^2 + y^2 + z^2}$. 
As far as I know $\vec\nabla$ represents a vector, which components are the partial derivatives of a given function and $\vec\nabla f(r)$ should be equal to  $\begin{pmatrix}\frac{\partial f}{\partial r} \end{pmatrix}$
or simply $f'(r)$ since $f(r)$ only depends on $r$. I could write $f(r)$ as a function of $x,y,z$ and 
$\vec\nabla f(x,y,z)$ would be equal to 
$\begin{pmatrix}
\frac{\partial r}{\partial x}\\ 
\frac{\partial r}{\partial y}\\ 
\frac{\partial r}{\partial z}
\end{pmatrix}$
How do I get the result of my textbook and what part did I misunderstand?

You are almost correct.  We can write
$$\nabla f(r)=\hat r f'(r) =\frac{\vec r}{r}f'(r) \tag 1$$
where $\hat r=\vec r/r$ is the radial unit vector, $r=\sqrt{x^2+y^2+z^2}$ is the radial variable, and $\vec r=\hat rr=\hat xx+\hat yy+\hat zz$ is the position vector.
Note that the partial derivatives of $r$ with respect to Cartesian variables $x_i$, $i=1,2,3$ are given by 
$$\frac{\partial r}{\partial x_i}=\frac{x_i}{r}$$
Multiplying by the corresponding Cartesian unit vector $\hat x_i$ and summing over $i$, we obtain 
$$\sum_{i=1}^3 \hat x_i\frac{\partial r}{\partial x_i} =\frac{\vec r}{r}\tag 2$$
Using $(2)$ in $(1)$ yields
$$\nabla f(r)=f'(r)\nabla (r)$$
which was to be shown!
