Let's say we have a set S of all rational number $\in (0,1)$. Now let us transform S to get a new set $S^{'}$ with the condition $x \in S \implies x + 1 \in S^{'}$. Now we again transform the set $S^{'}$ to get a new set $S^{"}$ with the condition $x \in S^{'} \implies \frac{1}{x} \in S^{"}$. Now number of elements in $S, S^{'} \;\&\; S^{"}$ is equal and all elements are rational. Also $x \in S$ satisfies $0 < x < 1 \;\&\; x \in S^{"}$ satisfies $\frac{1}{2} < x < 1$. So we have number of rational numbers $\in (0,1) = $ number of rational numbers $\in (\frac{1}{2}$, 1)? (which is clearly incorrect).
Even simpler, we can transform S to get a new set $S^{'''}$ with the condition $x \in S \implies \frac{x+1}{2} \in S^{'''}$. Again, all elements in $S \;\&\; S^{'''}$ are rational and number of elements in both sets is equal. Also $x \in S$ satisfies $0 < x < 1 \;\&\; x \in S^{'''}$ satisfies $\frac{1}{2} < x < 1$. So we have number of rational numbers $\in (0,1) = $ number of rational numbers $\in (\frac{1}{2}$, 1)? (which is clearly incorrect).
My question is : what is the flaw in both cases? I thought for a long time but I don't think I can find any problem in any of the methods.
P.S. : I am sorry if this was posted earlier somewhere on the site, I tried searching for it but could not find it.
So from all the answers I have gotten, and my own thinking about this question I have a kind of an explanation for this result which goes as follows :
Let us take the transformation from $S \to S''$
Let us take a rational number x and let us say the immediate next rational number of x is x+y. While converting to $S''$ we added 1 to both numbers and took their reciprocals so the new rational numbers ($\in [1/2,1]$) are $\frac{1}{x+1} \;\&\; \frac{1}{x+y+1}$. Let us find the difference between these two numbers.
It comes out to be $\frac{y}{(x+1) \cdot (x+y+1)}$ and since both $(x+1),(x+y+1) > 1$ we get $\frac{y}{(x+1) \cdot (x+y+1)} < y$
Thus we essentially squeezed two rational numbers $\in [0,1]$ into the interval $[\frac{1}{2},1]$ by reducing the "distance" between them.
Same can be done in the transformation of $S \to S'''$ where by dividing by 2 we reduced the "distance" between any two rational numbers by 2 and squeezed them into an interval length half of their original interval length.
This is also the case with the common example of lines and number of points (drawing 2 parallel lines of different lengths and when their ends are connected by 2 different lines, both visually have a different length but algebraically the same number of points : diagram for reference). When we are saying every point on line AR has a corresponding point on BR, we can see that what we have essentially done is reduced the distance between two successive points in BR and "squeezed" them into AR (if the distance between successive points in BR is x and angle between lines AR and BR is $\theta$ then distance between corresponding points in AR is $x \sin\theta$ and since $\sin \theta < 1$ the distance between corresponding successive points in AR is lesser than that in BR) (or increased the distance between two successive points in AR and fit them in BR (if the distance between successive points in AR is x and angle between lines AR and BR is $\theta$ then distance between corresponding points in AR is $\frac{x}{\sin\theta}$ and since $\sin \theta < 1$ the distance between corresponding successive points in BR is greater than that in AR)).
Thus we can conclude that any algebraic/geometric manipulation to make number of elements (infinite) in one set equal to that in another set of intuitively larger (or smaller) length, we unintentially/intentionally squeeze (or eleongate) the "distances" between successive elements of original set.