I want to underline what the first responding poster said* a minimization problem (other than 0) requires a constraint which still hasn't been stated.  Say, two curves and a condition that says "what is considered minimal" (the distance between them or along them?  a mutual distance from the origin?)*
You've also said you want f, but I assume f( x ) is the surface you gave, that the surface is not the constraint.  If the constraint is the surface and you gave us (grad f)={x1,x2,f[x1,x2]} then you've still withheld (grad f)={x1,x2,x3} meaning before you altered it.
I can only guess you mean the direction of greatest change is normal to the surface and of least change is tangent to surface as a condition.  In that light you want the equation that is always tangent to the surface and the gradient is not necessary since the surface was given.  If r[t,s] = surface given, then r'[t,s] (easily done by mathematica), is tangent to the surface at each point and so the direction of least change.  If you have N you should already have T, the tangent vector.
(* the vector valued surface *)
In[109]:= D[(a + t Cos[b s] - g[t] Sin[b s]) {Cos[s], Sin[s], 0} + {0,
    0, t Sin[b s] + g[t] Cos[b s]}, t, s]
(* the direction of least change, r'[t,s] *)
Out[109]= {Cos[s] (-b Sin[b s] - b Cos[b s] Derivative[1][g][t]) - 
  Sin[s] (Cos[b s] - Sin[b s] Derivative[1][g][t]), 
 Sin[s] (-b Sin[b s] - b Cos[b s] Derivative[1][g][t]) + 
  Cos[s] (Cos[b s] - Sin[b s] Derivative[1][g][t]), 
 b Cos[b s] - b Sin[b s] Derivative[1][g][t]}
If you mean minimal curvature K, then since you have a wavy sin cos surface then you may only need the maximum points of the surface to find minimal K or the 0 points for greatest K (ie, it may be a trick question not requiring the kind of solution your looking for).
You should ask a teacher or look in the book's "solution guide".  And you should ask people this kind of question without the problem FULLY TYPED OUT as the book had it (and page, and name) - which likely requires being in a different forum altogether.