We can making many functions of three variable by only use and combining of $\min$ and $\max$ functions. But many of them are not different , like :
$$\min(x,y,z)=\min(x,\min(y,z)),\quad\min(x,\max(x,y)) = \min(x,x) = \max(x,x)$$
How many different functions $\mathbb R ^3 \rightarrow \mathbb R$ of this form we have?
The upper bound of numbers of this functions is $3^{3!}$ . Because there are only $3!$ states for $x , y , z$ like: $ x < y < z$ and $ x < z < y$ and ... and each state gives one of the values of $\{x,y,z\}$ .
And my second question is :
How many different functions $\mathbb R ^n \rightarrow \mathbb R$ of this form we have ?
I think that there are $18$ functions of $3$ variables.
Those functions are $x$, $y$, $z$,
$\max(x, y)$, $\max(x, z)$, $\max(y, z)$, $\min(x, y)$, $\min(x, z)$, $\min(y, z)$,
$\max(x, \max(y, z))$, $\min(x, \min(y, z))$,
$\max(x, \min(y, z))$, $\max(y, \min(x, z))$, $\max(z, \min(x, y))$,
$\min(x, \max(y, z))$, $\min(y, \max(x, z))$, $\min(z, \max(x, y))$,
and $\max(\min(x, y), \min(z, \max(x, y)))$.
This last function simply returns the middle value among $x$, $y$, $z$.
I used Mathematica. I built a list of "basic" functions, i.e.
Then I combined previous lists of function by taking Min[a,b] and Max[a,b] where a and by were elements of previous list. I deleted duplicated considering the output of the functions on the $6$ permutations of $\{1,2,3\}$.
I stopped (quite soon, actually) when new functions where not arising anymore.
ADDENDUM: I run the same routine for $4$ variables and I got $166$ functions.
Now, searching $4,18,166$ on OEIS we got Sequence A007153, i.e.,
The next terms escalate quickly:
I'm not awake enough (be honest: smart enough) to confirm or deny the connection between this problem and Dedekind numbers, but I see some potential connections.