Is the function f R R defined by fx 2x 3 if x Q 4x 5 oth
Is the function f : R R, defined by
f(x) = ( 2x 3 if x Q
4x + 5 otherwise
injective (one-to-one)? Is f surjective (onto)?
Solution
If x is rational then so is 2x-3
If x is irrational then 4x+5 is also irrational.
Let, f(x)=f(y)
Case 1: x,y both rational
2x-3=2y-3
So, x=y
Case 2: x,y both irrational
4x+5=4y+5
Hence, x=y
Hence, f is one to one
Now check if f is surjective
Case 1: y is rational
Let, 2x-3=y
x=(y+3)/2
(y+3)/2 is also rational
f((y+3)/2)=y
Case 2: y is irrational
Let, 4x+5=y
x=(y-5)/4
(y-5)/4 is also irrational
f((y-5)/4)=y
So , f is onto
