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

Consider the function

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