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 depends on what exactly you mean by scalar.
Do you mean a function that's just a number? Then of course you can think up any function you want that turns three input numbers $x, y$ and $z$ into one output number $U(\vec{r}) = U(x,y,z)$. Examples would be $U(\vec{r}) = |\vec{r}| = \sqrt{x^2 + y^2 + z^2}$ or $U(\vec{r}) = x + y - 2z$, or just general definitions such as $U(\vec{r}) = $ temperature at location $\vec{r}$, or $\varrho(\vec{r}) = $ Charge density at location $\vec{r}$.
If, however, by scalar you mean an object that's not only a number, but also rotationally invariant, then your options are a tiny bit limited. An object that's invariant under rotation cannot depend on the specific direction of $\vec{r}$ but only on its magnitude, so the first example above would be a scalar, but the second example would not. 
EDIT: Since this was migrated from the physics SE, let me note that there are some subtle differences in nomenclature. In physics, the term "scalar" can have more meaning than "element of $\mathbb{R}$ or $\mathbb{C}$. It can mean: "Something that is invariant under rotation". Or, in the case of a Lorentz scalar, "something that is invariant under a certain transformation". 
