Prove that Real Numbers and the interval $(0,\infty)$ have the same cardinality.
Attempt:
Consider the function $f(x) = e^x$.
The domain of this function is all real numbers.
The range of this function is from $0$ to infinity.
Let $e^a = e^b$.
Then $\ln(e^a) = \ln(e^b)$
Then $a\ln(e) = b\ln(e)$
This means that $a = b$
Hence, $f$ is injective.
Let $c > 0$
Then $e^{ln(c)} = c$
Since $c > 0, \ln(c)$ is defined, so $f(\ln(c)) = c$
Therefore, f is surjective.
Then f is bijective.
Hence, $\mathbb{R}$ and $(0, \infty)$ have the same cardinality.
Best Answer
This is a valid proof. Essentially you have used the fact that the exponential function has a two-sided inverse (at least when the codomain is the positive reals), $\log$ (or $\ln$ if you prefer). Any function with a two-sided inverse is automatically a bijection. In fact, injectivity is precisely the same as having a left inverse and surjectivity is precisely the same as having a right inverse. Exercise: if a function $g$ has a left inverse $f$ and a right inverse $h$, then in fact $f = h$, so $g$ has a two-sided inverse.
Here are some other approaches you could use: