Can there be a scalar function with a vector variable? Can I define a scalar function which has a vector-valued argument?
For example, let $U$ be a potential function in 3-D, and its variable is $\vec{r}=x\hat{\mathrm{i}}+y\hat{\mathrm{j}}+z\hat{\mathrm{k}}$.
Then $U$ will have the form of $U(\vec{r})$.
Is there any problem?

The (more or less) canonical example is the divergence, here the divergence is of a vector valued function $\mathbf{F} = U(x,y,z)\hat{i} + V(x,y,z)]\hat{j} + W(x,y,z)\hat{k}$
$$\operatorname{div}\,\mathbf{F} = \nabla\cdot\mathbf{F}
=\frac{\partial U}{\partial x}
+\frac{\partial V}{\partial y}
+\frac{\partial W}{\partial z
}$$
