# Which must be true about the function f?

Let $A$ and $B$ be the two sets, such that $|A|=|B|$. There is a one to one function from $f:A\to B$.

Which of the following must be true about function $f$ ?

• $f$ is an onto function.
• $f$ has an inverse.

According to me, both are false if $A$ and $B$ are countable infinite set of Natural numbers.

So suppose, If there exists a function $f(i) = i^2$.

Well, in this case onto not possible which implies bijection not possible, hence no inverse possible .

But, I need some confirmation for my try .

• Your counterexample is correct. However, you may also want to check the context of your original question (if this is from homework or a book) if there is some implicit assumption that $A$ and $B$ are finite sets, in which case $f$ will be onto and will have an inverse. Jul 23, 2017 at 4:06
• @angryavian Actually, I have typed the same. There is nothing extra or by default assumed . Jul 23, 2017 at 4:10
• You said the function is "one to". What did you mean by that. Jul 23, 2017 at 5:18
• @fleablood: I imagine OP meant to write "one to one" or "injective." Jul 23, 2017 at 5:30
• @fleablood Consider that as typo. I've edited . Jul 23, 2017 at 6:06

If f is one-to-one then there is an inverse from the image of f, Im(f) to A: $$f^{-1}:Im (f)\subset B\rightarrow A$$ given by setting $f^{-1}(x)=y$ where y is the unique $y\in A$ such that $f (y)=x$. But if $Imf\subsetneq B$, then $f^{-1}$ is not defined on all of B. Since the image of your squaring function $i\rightarrow i^2$ is the perfect squares, the inverse is not defined on all of $\mathbb N$...
• Note though, that $f^{-1}$ can be extended to be a function on the domain of $\mathbb{N}$, such that it is a left inverse. So $f^{-1} (f(x)) = x$ Jul 23, 2017 at 5:45