# Onto and everywhere defined for functions having same cardinality

If A and B have same number of elements and particularly if A = B then we only need to prove one of either onto or everywhere defined to prove that it is a bijection.

Now I don't get this point. I will be thankful if someone can elaborate this with an example.

This is not true for infinite sets. Take $A=B=\mathbb{N}, f(n)=2n$. This is everywhere defined and one-to-one but not a bijection. For finite sets it is not true, either. You need onto or (everywhere defined and one-to-one). Otherwise, take $A=B=\{1,2\}, f(1)=f(2)=1.$ Given either onto or everywhere define and one-to-one, let $n=|A|=|B|,$ draw two sets of $n$ dots (like I did in a previous question) and connect them. If it is onto, you have to have $n$ distinct function values, so all $n$ elements must have defined values, and they must all be distinct. If it is everywhere defined and one-to-one, you have $n$ distinct values.