If S is a finite set of real numbers, then Z U S is coutably infinite. (Where Z is the set of all integers).

I was thinking something like this, but I'm not sure:

Without loss of generality let |S|= n and let S = {s1, s2, s3, ... sn) (where 1, 2... n are subscripts). Define f: Z --> Z U S as (piecewise function):

f(i) = i - n, where i >= n

i, where i < 0

si+1, where 0<= i < n (in si=1, i+1 is a subscript)

It seems like this function should work... f(n)=0, f(n+1)=1, etc., so I have all the positive integers and zero.

f(-1)=-1, etc., so I have all the negative integers.

When i is in [0,n), it should be f(0)=s1, f(1)=s2... f(n-1)=n. So I should have all of my set S.

I know what I just said isn't a formal proof of injectivity or surjectivity; I'm just trying to make sure this function makes sense and works for my proof. I also know that to be countably infinte you have to be a bijective function from the natural numbers to your set, but sense Z is also countably infinite it seemed like this way is easier.