Naive question, but my mind cannot reason today. Say I have the following function
$$f(x): \mathbb{R} \to [0, 1] ~~~~~~~~~~~ f(x) = 1 - e^{-x}$$
The function is
$\Box\ $ Injective and Surjective
$\Box\ $ Injective but not Surjective
$\Box\ $ Not injective but Surjective
$\Box\ $ Neither Injective nor surjective
This is my reasoning: for a function to be surjective, we need its codomain to coincide with its image. The codomain here is $[0, 1]$.
The image of the function $f(x)$ is $\mathbb{R}^+$, right? Or shall I have to consider what is its image "inside" the codomain I have?
In this case I would hence say the function is injective but not surjective.
Please just tell me if I'm right of if I said a load of nonsenses...
Add
I do also know that surjective means the codomain equals the domain of its inverse. Here the inverse is $-\ln(1-x)$ whose domain is $x < 1$, hence they do not coincide since the codomain is $[0,1]$. Right?
Injective:
$$f(x)=f(y)\Rightarrow1-e^{-x}=1-e^{-y}\Rightarrow e^{-x}=e^{-y}\Rightarrow -x=-y\Rightarrow x=y$$
Not Surjective:
Because for $1\in[0,1]$, there is no $x\in\mathbb{R}$ such that
$$1-e^{-x}=1\Leftrightarrow e^{-x}=0$$
So the function is not surjective.