I'm working through Khan Academy, and one of the criteria that Sal mentioned for a function to be invertible is that its range must be equal to its entire codomain, which means that one of the criteria is that the function must be surjective.
So for a function like $f(x)=e^x$ which is a mapping from ℝ^1 to ℝ^1, does it mean that $e^x$ is not invertible because the image (range) of $e^x$ is not the entire codomain ℝ^1?
For example, $e^x$ can never equal a negative number, and so automatically we know that $e^x$ does not span its codomain (the function's range is smaller than the codomain), which is ℝ^1.
However, we know that $e^x$ does have an inverse, and that inverse is $\ln\left(x\right)$.
Does this go against what the definition of a function being invertible? What am I getting wrong here?
Help would be appreciated.