Q:

Piecewise function within a proof. Verification.

Prove or give a counterexample. 
If $f$ is decreasing on $(-\infty,0)$ and if $f$ is decreasing on $[0, \infty)$, then $f$ is decreasing on all real numbers.
I have chosen to give a counterexample. 
I was wondering if I could use a piecewise function to do this.
What if I set $y=-x$ for the interval $(-\infty,0)$ and $y=1-x$ for the interval $[0,\infty)$? Since, there is a jump at $0$, can I say that the $f$ "increased" at $0$, and thus is not decreasing over all real numbers, or am I unable to do this? If so, why?
I was unsure of what to title this. Please, let me know if I need to change it. 

A:

Your answer is good. 
If there was the added condition that $f$ is continuous at $x=0$, then you could conclude that $f$ is decreasing on all of $\mathbb R$. You'd only have to prove that $f(y)>f(0)$ when $y<0$.

