So you propose to map an infinite set with a finite variable?
Your function is undefined because you refuse to define its terms, specifically the range of x, although you let it slip that x is “unbound”, aka “infinite”. But if x is infinite, “2x” and “2x+1” are undefined in your antiquated math model.
P has TWO infinite sets. You must have at very least one infinite variable to even try to map it. But when you do that, your function becomes incomprehensible, aka “undefined”.