30
$\begingroup$

I woke up this morning and had this question in mind. Just curious if such function can exist.

$\endgroup$
2
  • 4
    $\begingroup$ In case anyone has forgotten what “even” and “odd” functions are, $f$ is even if $f(x) = f(-x)$ and odd if $-f(x) = f(-x)$. See also Wikipedia on even and odd functions. $\endgroup$ Jun 17, 2012 at 18:54
  • 1
    $\begingroup$ You might find it interesting that I often used to ask this as an extra credit question on precalculus tests when even/odd function properties were covered, typically worth an extra 3 points on a 100 point scale (so a score of 103/100 was possible). I'd usually get about 2 to 5 students getting the extra points (out of a total of maybe 25-35 students) in a U.S. college precalculus class, and about half the class getting the extra points in U.S. honors level high school classes I used to teach. $\endgroup$ Jun 18, 2012 at 15:56

9 Answers 9

62
$\begingroup$

Others have mentioned that $f(x)=0$ is an example. In fact, we can prove that it is the only example of a function from $\mathbb{R}\to \mathbb{R}$ (i.e a function which takes in real values and outputs real values) that is both odd and even. Suppose $f(x)$ is any function which is both odd and even. Then $f(-x) = -f(x)$ by odd-ness, and $f(-x)=f(x)$ by even-ness. Thus $-f(x) = f(x)$, so $f(x)=0.$

$\endgroup$
3
  • 5
    $\begingroup$ Of course, one could argue that restrictions of the constant $0$ function to different domains symmetric about the origin are different functions, set-theoretically speaking. $\endgroup$ Jun 17, 2012 at 15:30
  • $\begingroup$ @CameronBuie That is true, I will make my answer more precise to indicate this. Thank you. $\endgroup$ Jun 17, 2012 at 15:31
  • $\begingroup$ Funny, I never thought of f(x) = 0 as a possibility. Thanks for the answers everyone! $\endgroup$
    – bodacydo
    Jun 17, 2012 at 21:06
31
$\begingroup$

If $K$ is a field of characteristic 2, every function $K\to K$ is both even and odd.

$\endgroup$
11
  • $\begingroup$ i'm sorry, wouldn't that be "unequal to 2"? $\endgroup$
    – akkkk
    Jun 17, 2012 at 15:31
  • 2
    $\begingroup$ @Auke: No. I won't spoil the joke by spelling it out, sorry. $\endgroup$ Jun 17, 2012 at 15:40
  • 9
    $\begingroup$ Actually, you don't even need a field, any ring of characteristic 2 will do. $\endgroup$ Jun 17, 2012 at 15:42
  • 1
    $\begingroup$ This is a wonderful answer! $\endgroup$ Jun 17, 2012 at 23:52
  • 1
    $\begingroup$ @Agos: Have a look at this wikipedia page, and try to work out the consequences of the characteristic being 2. $\endgroup$ Jun 18, 2012 at 11:33
18
$\begingroup$

Yes. The constant function $f(x) = 0$ satisfies both conditions.

Even: $$ f(-x) = 0 = f(x) $$

Odd: $$ f(-x) = 0 = -f(x) $$

Furthermore, it's the only real function that satisfies both conditions:

$$ f(-x) = f(x) = -f(x) \Rightarrow 2f(x) = 0 \Rightarrow f(x) = 0 $$

$\endgroup$
10
$\begingroup$

Hint $\rm\ f\:$ is even and odd $\rm\iff f(x) = f(-x) = -f(x)\:\Rightarrow\: 2\,f(x) = 0.\:$ This is true if $\rm\:f = 0,\:$ but may also have other solutions, e.g. $\rm\:f = n\:$ in $\rm\:\mathbb Z/2n =\:$ integers mod $\rm 2n,$ where $\rm\: -n \equiv n.$

$\endgroup$
2
  • $\begingroup$ +1, but note that your last $\iff$ applies (in the backwards, i.e. 'if' direction) only to $f(x) = -f(x)$, and not to the part where $f(-x)$ equals both of them. $\endgroup$ Jun 17, 2012 at 18:04
  • $\begingroup$ Yes, I meant to write $\:\Rightarrow\: $ but it was lost in editing. Now fixed. Thanks. $\endgroup$ Jun 17, 2012 at 18:19
4
$\begingroup$

Suppose $f$ odd an even. Let $x \in D$ ( D is set definition of $f$) then you have : $ f(x)=f(-x)=-f(x)$. What can you conclude about $f$ ?

$\endgroup$
3
$\begingroup$

As other people have mentioned already, the real function $f(x)$ which maps every real number to zero (i.e.$f(x) = 0 \space \forall x \in \mathbb{R}$) is both even and odd because $$f(x) - f(-x) = 0 \space \space , f(x)+f(-x) = 0\space \forall x \in \mathbb{R} .$$ Also it is the only function defined over $\mathbb{R}$ to possess this property.

$\endgroup$
2
$\begingroup$

Let $R$ be a Boolean ring and $X$ be an arbitrary set. Then every function $f:R\rightarrow X$ is both even and odd.

$\endgroup$
3
  • $\begingroup$ Say what........? $\endgroup$
    – bodacydo
    Sep 9, 2015 at 7:06
  • $\begingroup$ @bodacydo for example: any polynomial $P(x)\in R[x]$. $\endgroup$
    – user48941
    Sep 9, 2015 at 7:31
  • $\begingroup$ Thanks that is useful to know! $\endgroup$
    – bodacydo
    Sep 9, 2015 at 20:12
2
$\begingroup$

I post this as an addendum to the awesome answers already present for this Q.

Most trivial example:

For $f(x)=0$ we have:

$f(x)= 0 =-f(-x)$ Hence, Odd

$f(x)= 0 =f(-x)$ Hence, Even

I was searching for an answer to my question.

$f(x) = \sin(x) + \sin(\pi + x)$

Here, the function is also even and odd at the same time (another example or representation of the same). This is due to the value resulting in zero over the entire domain. So, it can be concluded that all the functions that have their $Range=\{0\}$ should be both even and odd at the same time despite their notation is of a constant function($f(x)=0$) or not.

Another example,

$f:\{1,-1\}\to \mathbb{R}$

$f(x) = x^{2}-1$

$f(x) = 0$ for all values in the domain. So, it is both even and odd at the same time because while deciding even odd functions the domain to which the function is restricted by definition must be considered.

$\endgroup$
1
$\begingroup$

We could also think even and odd functions as the following to get $f(x) = 0$ is a function that is both odd and even and go for some different functions:

Odd functions have graphs that are symmetric with respect to origin.

Even functions have graphs that are symmetric with respect to $y$-axis.

So, graph of $f(x) = 0$ satisfies both conditions, therefore it is both odd and even. Furthermore, we can define some piecewise functions that satisfies this condition using their graphs. For example, let $f(x)$ not defined on intervals $(-1,-2)$ and $(1,2)$; and whenever it is defined, $f(x) = 0$. Then $f(x)$ is, again, both even and odd. And as long as we define a piecewise function by removing intervals that are symmetric with respect to $y$-axis, and rest of the function $= 0$ even though they are not continuous.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.