R as Q Vector space/Q to Q else zero/Exercise

Consider the function

which sends a rational number

to , and all the irrational numbers to . Is this a linear map? Is it compatible with multiplication by a scalar?