Let me make the question more precise:

Let A be the set of all points in R^n such that each of its coordinates is rational, and let B=R^n-A. My question is, is there a smooth map f:R^n --> R^{n-1} such that Im(f|_A) \cap Im(f|_B)=\emptyset?

This might be a solved question, but I could not find any reference for it. I would guess no such smooth map exists. Here is some of my thinkings: if Im(f|_A) contains a regular value, say a is such a value, then f^{-1}(a) is a 1-dimensional submanifold of R^n, hence contains some point in B; if Im(f|_A) has no regular value, then by density of A in R^n, Im(f) consists of singular values. By Sard's theorem, Im(f) is a Lebesgue measure 0 (connected) subset of R^{n-1}. As a simple example, if n=1, then in this case, f must be constant. I don't know how to continue in general.