I don't think that works, though. Take for example these two coordinates:
(30, 75)
(90, 225)
Those would both map to the same rational—2/5—and that would make it not a one-to-one mapping.For example, the set of all pairs of natural numbers can be counted something like this:
1,1
2,1
2,2
1,2
3,1
3,2
3,3
1,3
2,3
...0 1 2 3 4
0 -1 1 -2 2
in c code: if(x<0) ? (x * -2)-1 : x * 2;
(pretend that's fixed width above)
Next, any rational can be broken down into a unique prime factorization. 4/6 = 2^1 * 3^-1, 4/15 = 2^2 * 3^-1 * 5^-1
From the factorization, define a transform where the exponent for each prime is replaced using the mapping above: so (2^2 * 3^-1 * 5^-1) becomes (2^4 * 3^1 * 5^1) = 240.
Since the original rational can be negative, you'll need to use the first transformation again, so 4/15 = 240, -4/15 = -240, which work out to 480 and 479 respectively.
0 and 1 are left unchanged by the factorization process so 0 maps to 0, 1 to 2, and -1 to 1.
This is true for a finite number of divisions of the pixels. But is it still true for an infinite number of divisions?
You can identify each pixel by two other pixels along your chosen edges (axes). The set of pairs drawn from countable sets is always countable.
It is for a finite number of divisions. But is it for an infinite number of divisions?
You are basically assuming that the limit point of a given sequence must have the same properties as every item in the sequence. That is obviously false; for example, many limit points of sequences of rational numbers are not rational numbers. So you can't just help yourself to the assumption that, because each pixel's coordinates have a certain property after a finite number of divisions, the coordinates will still have the same property after an infinite number of divisions.
There are no limits involved here. Just a construction of an infinite series of rational coordinates.