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?

That's a perfectly fine thing to do.  The classic example of such a field is the temperature in a room: the temperature $T$ at each point $(x,y,z)$ is a function of a $3$-vector, but the output of the function is just a scalar ($T$).  $\phi^4$ scalar fields are also an example, as are utility functions in economics.
