# Can there be a function that's even and odd at the same time?

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

-

3
– Rory O'Kane Jun 17 '12 at 18:54

1
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. – Dave L. Renfro Jun 18 '12 at 15:56

## 6 Answers

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.$

-

5
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. – Cameron Buie Jun 17 '12 at 15:30
@CameronBuie That is true, I will make my answer more precise to indicate this. Thank you. – Ragib Zaman Jun 17 '12 at 15:31
Funny, I never thought of f(x) = 0 as a possibility. Thanks for the answers everyone! – bodacydo Jun 17 '12 at 21:06

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

-
i'm sorry, wouldn't that be "unequal to 2"? – akkkk Jun 17 '12 at 15:31

1
@Auke: No. I won't spoil the joke by spelling it out, sorry. – Harald Hanche-Olsen Jun 17 '12 at 15:40

5
Actually, you don't even need a field, any ring of characteristic 2 will do. – Ilmari Karonen Jun 17 '12 at 15:42
@HaraldHanche-Olsen, oh, I am sorry, I misread your answer, you are completely right :) nice one – akkkk Jun 17 '12 at 15:43

1
This is a wonderful answer! – Edward Hughes Jun 17 '12 at 23:52
show 4 more comments

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$$

-

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.$

-

+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. – ShreevatsaR Jun 17 '12 at 18:04
Yes, I meant to write $\:\Rightarrow\:$ but it was lost in editing. Now fixed. Thanks. – Gone Jun 17 '12 at 18:19

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$ ?

-

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.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 30, "mathjax_display_tex": 4, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9371247887611389, "perplexity_flag": "middle"}