During the lecture we learned this phrase:
"If $f$ is a function then $f^{-1}$ is a function iff $f$ is injective (one-to-one)."
But why? What with onto? $f$ doesn't need to be Surjective (onto)?
For example: $$f:A \rightarrow B$$ $$A=\{1,2,3\} $$ $$B=\{1,2,3,4\} $$ $$f=\{(1,1)(2,2)(3,3)\}$$
$f$ is an injective function but $ f^{-1} $ can't be a function because for 4 we can`t find a place to go.