Vector spaces of montone functions This might be quite trivial and I may be missing something obvious. Let $V$ be a vector space of functions from $\mathbb  R$ into itself such that every function in $V$ is monotonic. Does it follow that the dimension of $V$ is at most $2$?
$\{ax+b: a,b \in \mathbb R\}$ shows that the dimension can be $2$.
Suppose $f$ and $g$ are linearly independent elements of $V$. By changing signs we may suppose that $f$ and $g$ are both increasing. If $f+ng$ is monotonically decreasing for infinitely many values of $n$ and $x<y$ then $f(x)+ng(x)\geq f(y)+ng(y)$ and $f(x)-f(y) \geq n (g(y)-g(x))$. Since $g(x) \leq g(y)$, this is a contradiction unless $g(x)=g(y)$. Thus, $g$ is a constant in this case.
I am unable to finish the proof and any help would be appreciated.
 A: We might as well add in the constant functions; $\operatorname{span}(V \cup \{1\})$ will also consist only of monotone functions. So, let's assume without loss of generality that the constant functions are indeed in $V$.
Suppose $V$ has dimension at least $3$ (possibly infinite). Then we may extend $\{1\}$ to a linearly independent set containing (at least) two other functions $f$ and $g$.
For any $a < b$, I claim there is a non-zero function in $\operatorname{span}\{f, g, 1\}$ that is $0$ on $\{a, b\}$. Consider the function
$$(g(b) - g(a))(f - f(a)1) - (f(b) - f(a))(g - g(a)1) \in \operatorname{span}\{f, g, 1\}.$$
If the above function is the $0$ function, then the linear independence of $\{1, f, g\}$ implies $g(b) = g(a)$ and $f(b) = f(a)$. If one of the preceding numbers is $0$, then $f$ or $g$ will fill this role. Otherwise, $g(b)f - f(b)g$ will fill this role. So, either which way, we can find such a function, which we will call $h_{a, b}$.
Since $h_{a, b}$ is monotone, we therefore see that $h_{a, b}(x) = 0$ for all $x \in [a, b]$.
Now, fix $x_0 > 0$, and consider $h_{-x_0, x_0}$. Since $h_{-x_0, x_0} \neq 0$, there must exist some $x_1 > |x_0|$ such that $h_{-x_0, x_0}(x_1)$ or $h_{-x_0, x_0}(-x_1)$ is non-zero. Similarly, we can, for $n = 1, 2, 3$ find $x_n$ such that $h_{-x_{n-1}, x_{n-1}}(x_n)$ or $h_{-x_{n-1}, x_{n-1}}(-x_n)$ is non-zero.
Note that $\{h_{-x_n, x_n} : n = 0, 1, 2, 3\}$ is linearly independent, which we can see by restricting it to the set $\{\pm x_0, \pm x_1, \pm x_2, \pm x_3\}$. However, this is a subset of $\operatorname{span} \{f, g, 1\}$, which is of dimension at most $3$ (well, equal to $3$ by assumption). This is a contradiction, so $\{f, g, 1\}$ must be linearly dependent.
