# Continuation of strictly monotone functions on $\mathbb{R}$

While studying the properties of ordinal utility functions, I came across the following question.

Given a strictly increasing function $f : D \rightarrow \mathbb{R}$, where $D$ is an arbitrary non-empty subset of $\mathbb{R}$, can one always find a strictly increasing function $g : \mathbb{R} \rightarrow \mathbb{R}$ that is defined everywhere on $\mathbb{R}$ and is equal to $f$ everywhere in the set $D$?

I feel that the answer should be positive, however, there might be some counterexample I'm unaware of.

-
Maybe it helps to ask that $D$ be closed an $f$ be continuous? –  Rasmus Sep 15 '12 at 9:52
Given the counterexamples found below, it makes only sense to ask for such a continuation if $f$ is bounded on every bounded subset of $D$ and one drops the condition that the monotonicity should be strict. But then $g(x):=\sup\{f(x)\mid x\in D\cap (-\infty,x]\}$ for $x>\inf D$ and $g(x)=\inf\{f(x)\mid x\in D\}$ for $x\le\inf D$ will work. –  Hagen von Eitzen Sep 15 '12 at 12:41

No, consider for instance the case where $D=(0,1)$ and $f$ is the function given by $f(x)=-\frac1x$.

There cannot exist a stricly increasing extension of $f$ to $\mathbb R$ because $\lim\limits_{x\to 0^+}f(x)=-\infty$.

(That is, the value of the extension at any non-positive point would have to be lower than any real number. That is not possible.)

-
Your response is really helpful, I now see how I should refine my question. I would accept your answer as soon as the 15min timelimit passes. –  viaclectic Sep 15 '12 at 9:26
@viaclectic: That's nice to hear. Good luck with refining your question! –  Rasmus Sep 15 '12 at 9:27
@viaclectic: One refinement is to require the function is bounded in every bounded subset of $D$. –  Asaf Karagila Sep 15 '12 at 9:47
@AsafKaragila: girianshiido's answer seems to show that that is not enough. –  Rasmus Sep 15 '12 at 9:51
True. So being extendible is a relatively strong requirement. –  Asaf Karagila Sep 15 '12 at 9:53
Another counterexample : set $D=(-\infty,0[\cup[1,+\infty)$, and define $f$ on $D$ like this : $$f(x)=\begin{cases}\begin{array}{ccc}x& \text{if}& x<0 \\ x-1 & \text{if} & x\geq 1\end{array}\end{cases}$$
Assume that $g$ exists and choose $x\in[0,1)$. For all negative $y$, you'll get : $$g(y)=f(y)=y<g(x)<g(1)=f(1)=0$$ so $g(x)$ should be greater than any negative number yet less than $0$. This is absurd.