We know that $f(x)$ is odd if $-f(x)=f(-x)$. The function is $$f(x)=\begin{cases}2x-1&\text{if $-2<x<0$},\\2x+1&\text{if $0\leq x\leq2$}.\end{cases}$$
Now I want to know if $f$ is odd, so I query to WA is Piecewise[{{2x-1,-2<x<0},{2x+1,0<=x<=2}}] an odd function?:
I get the answer:
Now, if we query plot -Piecewise[{{2x-1,-2<x<0},{2x+1,0<=x<=2}}] from -2 to 2 then we see the graph of $-f(x)$:
If we query plot Piecewise[{{2(-x)-1,-2<-x<0},{2(-x)+1,0<=-x<=2}}] from -2 to 2 then we obtain $f(-x)$:
As the plots are the same, then $-f(x)=f(-x)$, so the function is odd.
However in the first input, WA did not recognize that. Why?




