[Math] Finding a monotonically increasing function with limit 1

functions

To polish/improve a homework answer, I am trying to find a monotonically, continuous, strictly increasing function $f$ with these properties:

  1. $f(0) = 0$
  2. $\lim_{x \to \infty} f(x) = 1$

(I don't care what happens when $x < 0$.)

This task seems harder than I thought. My first instinct was to use something related with logs, but the problem there is that $\log x$, while it has a similar shape as the function I'm hoping to derive, will exceed 1.

My next thought was to use $f(x) = 0$ if $x = 0$ and $f(x) = \frac{x-1}{x}$ if $x > 0$ (and undefined if otherwise), but the problem is that when $x < 1$, we can get negative values, and if I try to set another case, it's difficult for me to ensure that, for instance, $f(0.09) < f(1.01)$.

Does anyone have any advice? And furthermore, does anyone have strategies on how to create functions satisfying certain properties should I need to do these things in the future?

Best Answer

Another, more natural example (to me anyway) is $$f(x)=1-\frac{1}{x^2+1}.$$ This has the advantage that the limit to $\pm \infty$ is $1$.