Motivation
It is well-known that any binary operator $*$ on the boolean ring $\{0,1\}$ can be represented using only one of the $\operatorname{NAND}$ and $\operatorname{NOR}$ operators. For example, $$x\rightarrow y=\big((x\operatorname{NOR}x)\operatorname{NOR}y\big)\operatorname{NOR}\big((x\operatorname{NOR}x)\operatorname{NOR}y\big)$$ and \begin{align}x\operatorname{XOR}y&= \Big(\big((p\operatorname{NAND}p)\operatorname{NAND}(q\operatorname{NAND}q)\big)\operatorname{NAND}\big((p\operatorname{NAND}p)\operatorname{NAND}(q\operatorname{NAND}q)\big)\Big) \\&\hphantom{123}\operatorname{NAND}\Big(\big((p\operatorname{NAND}p)\operatorname{NAND}(q\operatorname{NAND}q)\big)\operatorname{NAND}\big((p\operatorname{NAND}p)\operatorname{NAND}(q\operatorname{NAND}q)\big)\Big),\end{align} where $$p=\big(x\operatorname{NAND}(y\operatorname{NAND}y)\big)\operatorname{NAND}\big(x\operatorname{NAND}(y\operatorname{NAND}y)\big)$$ and $$q=\big((x\operatorname{NAND}x)\operatorname{NAND}y\big)\operatorname{NAND}\big((x\operatorname{NAND}x)\operatorname{NAND}y\big).$$ The notation $\rightarrow$ is the implication connective, and $\operatorname{XOR}$ is the exclusive-or operator.
Definitions
Let $S$ be a set and $f:S^m\to S$ is an $m$-ary function (or $m$-ary operator). A valid expression in $f$ is an expression $E(x_1,x_2,\ldots,x_n)$, where $x_1,x_2,\ldots,x_n\in S$ involving only finite iterations of $f$ and using only variables among $x_1,x_2,\ldots,x_n$.
For example, if $m=n=2$ and $0\in S$, $f\big(x_1,f(0,x_2)\big)$ is not a valid expression because there is a constant $0$ that is not in the form of the variables $x_1,x_2$. If $m=2$, $n=1$, $S=\mathbb{R}_{>0}$, and $f(x_1,x_2)=\sqrt{x_1\sqrt{x_2}}$, then this is also not a valid expression because it involves infinite iterations of $f$: $$f\Biggl(x,f\Big(x,f\big(x,f(\ldots)\big)\Big)\Biggr)=\sqrt{x\sqrt{x\sqrt{x\sqrt{\ldots}}}}\ (=x).$$ (However, if you want to represent the identity function $x\mapsto x$ on $S=\mathbb{R}_{>0}$ with the function $f(x_1,x_2)=\sqrt{x_1\sqrt{x_2}}$, this can be done without involving infinite iterations of $f$ like the previous example, i.e., $f\big(f(x,x),x\big)=\sqrt{(x\sqrt{x})\sqrt{x}}=x$.)
For $m=n=3$, this is a valid expression of $f$: $$f\Biggl(f\big(x_1,x_2,f(x_1,x_3,x_2)\big),f\Big(f\big(x_1,f(x_2,x_3,x_1),x_3\big),x_2,x_1\Big)\Biggr).$$ Also, not all variables need to be used. So, for $m=n=2$, $$f\big(x_1,f(x_1,x_1)\big)$$ is still a valid expression of $f$. In the previous example, one can say that this is a valid expression of $f$ with $m=2$ and $n=1$, as well. There can also be more variables than the number of arguments of $f$, that is, if $m=2$ and $n=3$, $$f\big(f(x_1,x_2),f(x_2,x_3)\big)$$ is a valid expression of $f$.
Let $g:S^n\to S$. We say that $g$ is representable by $f$ if there exists a valid expression $E(x_1,x_2,\ldots,x_n)$ of $f$ such that $$g(x_1,x_2,\ldots,x_n)=E(x_1,x_2,\ldots,x_n)$$ for all $x_1,x_2,\ldots,x_n\in S$. For an $m$-ary function $f:S^m\to S$, we say that $f$ is $n$-fulfilling if every $n$-ary function $g:S^n\to S$ is representable by $f$.
Question
For a given non-empty set $S$ and positive integers $m,n$, when does there exist a $n$-fulfilling $m$-ary function $f:S^m\to S$? Does there exist a set $S$ with $|S|\geq 3$ along with a positive integer $m$ such that for some an $m$-ary function $f:S^m\to S$ exists, and for any positive integer $n$, every $n$-ary function $g:S^n\to S$ is representatble by $f$.
Has there been a study on this type of questions? Any reference is greatly appreciated.
Known Results
If $S$ is infinite, then there are only countably many valid expressions of $f$ in $n$ variables, but there are uncountably many $n$-ary functions $g:S^n\to S$. Therefore, such a function $f$ does not exist. Hence, we can assume that $S$ is finite.
If $m=1$, then there exists an $n$-fulfilling function $f:S\to S$ if and only if $|S|=1$ or $\big(n,|S|\big)=(1,2)$. Clearly, the only valid expression of $f$ in any number of variables is of the form $f^k(x)$. Therefore, when $|S|>1$, there can only be one variable, so $n=1$. However, since the permutation group on $S$ is not abelian for $|S|>2$, we must have $|S|=2$ (provided that $|S|>1$).
Of course, if $|S|=1$, then any $m$-ary function $f:S^m\to S$ and any $n$-ary function $g:S^m\to S$ have the same image. So, this case is very trivial. If $|S|=2$, I think that we can identify $S$ as the boolean ring $\{0,1\}$ and use the $\operatorname{NAND}$ or $\operatorname{NOR}$ operators to represent any $n$-ary function $g:S^n\to S$.
For the Bounty Prize
I am willing to award the prize for
An example of $(S,m,n)$ with $|S|\geq 3$ and $m\geq 2$ such that there does not not exist an $m$-ary function $f:S^m\to S$ that is $n$-fulfilling, or a proof without an explicit construction that such $(S,m,n)$ exists.
An example of $(S,m,n)$ with $|S|\geq 3$ and $m\geq 2$ such that an $m$-ary function $f:S^m\to S$ is $n$-fulfilling, or a proof without an explicit construction that such $(S,m,n)$ exists.
Any stronger result than 1. and 2.