We all might be familiar with the beautiful method Cantor devised to prove that the cardinality of the set of real numbers is more than that of the set of natural numbers (Refer to: https://en.m.wikipedia.org/wiki/Cantor%27s_diagonal_argument). His method involved mapping each natural number to unique real number, no two natural numbers can map to same real number, and then showing that there are always real numbers left which are not assigned to any natural number.
But what can we say about the cardinalities of the sets $A$ and $B$ defined as $$A=\{x \ |\ x\in (0,1]\}$$ $$B=\{x \ |\ x\in [1,\infty)\}$$
Is the cardinality of $A,$ written as $|A|$ less than or equal to $|B|$?
I think that $|A|=|B|$ and I think so based on the following reasoning. Now I would use somewhat similar argument as Cantor did, in the sense that I will define one to one mapping of elements from set $A$ to set $B$.
Let us define a function, $f:[1,\infty)\rightarrow (0,1]$ defined by $$f(x)=\frac{1}{x}$$ It's easy to see that this is a one-one function. So we have mapped every real in $A$ to some unique real in $B$. And we have done this for all the elements of $A$ and $B$, as is clear from the fact that this is an invertible function.
So what's wrong in saying that this argument proves $|A|=|B|$?
Please express your thoughts on this.
Thanks:)