[Math] Function with domain all real numbers and range $(0,1)$

discrete mathematicsfunctions

Is there a one-to-one function whose domain is all real numbers and range is $(0,1)$?

I can't find any so I was thinking about trying to find a piece-wise function that meets the requirements, but I'm having a lot of trouble doing that too.

This is a part of the problem I'm trying to solve to show that two sets have the same cardinality.

Any help is appreciated!

Best Answer

The logistic function satisfies those requirements:

$$ f(x) = \frac{\exp(x)}{1+\exp(x)} $$