You are correct. To be precise, in set theory a function is usually defined as a special kind of relation.
Definition. A relation $f\subseteq X\times Y$ is called a function $f:X\to Y$ if for any $x\in X$ there is one and only one $y\in Y$ with
$$(x,y)\in f \quad(\text{or, if you want } xfy).$$
This will generalize naturally to $n$-ary functions when you consider $X=X_1\times\cdots\times X_n$. Then you will have that an $n$-ary function is a special kind of $(n+1)$-ary relation on $X_1\times\cdots\times X_n\times Y$.
You are correct. To be precise, in set theory a function is usually defined as a special kind of relation.
This will generalize naturally to $n$-ary functions when you consider $X=X_1\times\cdots\times X_n$. Then you will have that an $n$-ary function is a special kind of $(n+1)$-ary relation on $X_1\times\cdots\times X_n\times Y$.