# function undefined at odd inputs

I am a high-school student in pre-calculus. My teacher told me today that it is impossible to define a function using only multiplication, division, exponents, addition, subtraction such that it would be undefined at every odd input (that is $x \bmod 2$ is $1$). I, of course, wanted to disprove her and I made up this equation that turns any function $f(x)$ into a function that has domain $\mathbb{R} \mid \lfloor x\rfloor\bmod 2\neq0$! $$g(x)=\frac{1}{(-1)^{\lfloor x \rfloor}+1}-\frac{1}{2}+f(x)$$ feeding in an odd number will cause the fraction to become undefined. but feeding in an even number will cause the fraction to equate to one half, and after subtracting one half, $f(x)$ should work as defined.

What bothers me is that I googled $(-1)^x$ and any other form of $y=(-a)^x$ and simply could not find anything. My question is: What did I just do? Is there a name for this? Is my precal teacher insane??

• Is the floor function one of those four functions? – user122283 Sep 10 '14 at 1:34
• You need to be more specific. Some potential problems with your construction are: 1) The floor function does not count as an elementary operation; 2) $(-1)^x$ is complex-valued for many $x \in \mathbb{Q}$ (e.g. $\frac{1}{2}$), so if your range is restricted to $\mathbb{R}$, then it would additionally be undefined for those numbers. – Fengyang Wang Sep 10 '14 at 1:34
• okay, even if floor is not used: you can write $$g(x) = \frac{1}{(-1)^x+1}-\frac{1}{(-1)^x+1} + f(x)$$ which would make g(x) undefined at any strictly integer odd inputs – Will Sherwood Sep 10 '14 at 1:36
• @FengyangWang look at my new function I propose in the comments. aBecause any number subtracted from itself (complex or real) is 0, the above formula should work. no floor function and no dealing with complex – Will Sherwood Sep 10 '14 at 1:39
• @John Yes, but that would only work if $f$ itself was, in the beginning, defined through the four elementary operations and was undefined at the odd numbers. I understand that you haven't had much formal experience in math, and therefore I have not downvoted your question. If you would like to find a proof of the statement that your teacher made, or would like to find a counterexample, please tell it in the comments or edit your question. I might not be able to be of much more help, as I myself have some homework to complete. – user122283 Sep 10 '14 at 1:42

Your function (or a variation of the theme) is correct as specified if:

• You restrict the domain of the function to the integers $\mathbb{Z}$ or
• You allow the range of the function to the complex numbers $\mathbb{C}$.

Either will correctly mean that the function is undefined only on the odd integers.

However, this is why you must be more specific. Supposing that you were looking at functions $f: \mathbb{R} \to \mathbb{R}$. Then it is the case that:

$$f(x) = \frac{1}{(-1)^x+1}$$

(which is the building block of any similar function) is undefined on more than just the odd integers. For instance, it is intuitively obvious that such a function is also undefined for $x=\frac{1}{2}$, which is not real valued. Indeed, such a function is undefined for practically every real number, with the exception of even integers, though this is far from being intuitive. I suspect (but cannot prove) that your teacher is correct for functions mapping real numbers to real numbers.

Also, as a tangentially related point, note also that defining $(-1)^x$ for $x \in \mathbb{R}$ is a much more complex task than doing it for integers. It is not obvious that the function is not real valued for any reals that are not also integers. Although we are working solely with real numbers, defining such a function is much simpler when complex exponentiation is used as a starting point.