Examples of functions which maintain the ordering of an ordered set in an interesting way. I'm looking for functions $f(x, m)$ with the following property. Let $(x, y, z, ...)$ be an ordered set of positive real numbers such that $(x < y < z < \cdots)$. I'm looking for a function which for sufficiently large $N$, $f(x, N) < f(y, N) < f(z, N) < \cdots$, and for sufficiently small $n$, $f(x, n) > f(y, n) > f(z, N) > \cdots$. And for which there is no $m$, such that $n < m < N$, for which $f(x, m) = f(y, m) = f(z, m) = \cdots$.
I'm looking for any functions which when given a very large parameter will maintain the sortedness of a set of numbers, and when given a very small parameter, will cause the set to be in reverse order, but which "jumbles" the ordering somewhere in the middle rather than simply condensing everything to a single point before the ordering is reversed. An example of a function which fails is $f(x, m) = mx$. For $m>0$ this will monotonically increase (maintaining the ordered property), and for $m<0$ it will monotonically decrease, but it fails on the last point since $m=0$ takes everything to the same point. This is just for my own interest, so anything remotely related is appreciated. 
 A: Let 
$$
f_m (x) = (x - m) ^ 2 + A * \sin (200 * A * (x-m) )
$$
That'll mess up the sorting for $ m - \sqrt{A} < x < m + \sqrt{A}$, more or less, but provide ordinary ordering for $x >> m$ and opposite ordering for $x << m$. The sine in there is just a way of getting kind of random numbers in some modest range. (In this case, with values between $-A$ and $A$
A: Recall (or learn!) that a differentiable real-valued function is increasing if it has non-negative derivative everywhere, and decreasing if it has non-positive derivative everywhere (note that there are increasing functions which sometimes have zero derivative, but also functions with zero derivative that are non-increasing).
So think about the derivative -- for large $N$, you want it to be wholly above zero, and for small $N$ you want it wholly below, and then you want a bit in between. The easiest thing to imagine doing is just having some squiggle that hovers around the same value, and then moving it up or down by some constant amount, so that it's always positive or sometimes negative or always negative. So have $N$ be the shift amount, and you get something like this:
\[f(x,N) = Nx + g(x)\]
where $g$ is some nonmonotonic function with bounded derivative, e.g. $\sin$. Essentially this is your original function but with some "noise" added so that it's not too boring at $N = 0$.
Of course, adding a constant shift isn't the only way to move a function wholly above zero. You can do more subtle things, like adding multiples of some other strictly positive function of $x$. Or something else more exotic entirely, like having $m$ be "number of iterations of the exponential function" (except be careful with negatives, because iterates of $\log$ tend to get increasingly badly-behaved).
Moreover, as I mentioned previously, not every solution is captured this way, because (a) there are monotonic functions with sometimes-zero derivative and (b) we're not at all considering non-differentiable functions.
A: Let $D$ be the number of data points.
If $p(x)= x^{2d} + a x^{2d-1}+\ldots $ is an monic polynomial of even degree 
then $f_m(x)= p(mx)$ has the property that for large $m>>0$   the function is increasing (preserving order), and yet for $-m>>0$ the function is decreasing (reversing order).  Now consider what happens for intermediate values of the parameter $m$. A polynomial $f_m(x)$ whose degree is either $2d$ (or, in a degenerate case (when $m=0$) is $2d-1$) can be constant at all $D$ distinct points in data set only when the  polynomial is of degree at least $D$. So if you  choose $2d<D$ then  all the criteria you specified will be satisfied. This gives you lots of examples of solutions to your problem.
