For simplicity let's assume we are only working with $\mathbb{R}^3$.
We are given a parametric surface $s = <(X(u,v), Y(u,v), Z(u,v))>$ and a function $f: \mathbb{R^3}\rightarrow\mathbb{R}$. This implies that $f(s(u,v)) = F(u,v)$ for some function $F:\mathbb{R}^2 \rightarrow \mathbb{R}$.
The gradient of $F$ is merely $\nabla F = <\frac{\partial F}{\partial u}, \frac{\partial F}{\partial v}>$
This implies that:
$\nabla f = <\frac{\partial f}{\partial X}\frac{\partial X}{\partial u} + \frac{\partial f}{\partial Y}\frac{\partial Y}{\partial u} + \frac{\partial f}{\partial Z}\frac{\partial Z}{\partial u}, \frac{\partial f}{\partial X}\frac{\partial X}{\partial v} + \frac{\partial f}{\partial Y}\frac{\partial Y}{\partial v} + \frac{\partial f}{\partial Z}\frac{\partial Z}{\partial v}>$
This gives us the gradient expressed in the space of the domain, however, the gradient must also exist in the 3D space in which the surface is embedded. How do you obtain the gradient expressed in 3D?
(Also I am not entirely sure that my derivation is correct, so if it isn’t please let me know)