Grad is a vector and operates on a scalar, usually written ∇U, where U=f(x,y,z) in ℝ³, for example. As an operator ∇=<∂/∂x,∂/∂y,∂/∂z>.
∇U=<∂U/∂x,∂U/∂y,∂U/∂z>.
Curl(∇U)=∇×∇U=∇×<∂U/∂x,∂U/∂y,∂U/∂z>.
Curl(∇U)=<∂²U/(∂y∂z)-∂²U/(∂z∂y),∂²U/(∂z∂x)-∂²U/(∂x∂z,∂²U/(∂x∂y)-∂²U/(∂y∂x)>=<0,0,0>, so curl(grad(U))=0. Since U is arbitrary, this must apply for U with any number of variables.