Till today, I always thought that if the derivative of a function is $0$ at every point in the domain, then the only functions possible for which this is true are constant functions. But, my teacher gave me the example $f:(0,1)\cup (1,2)\to \Bbb R$ with
$f(x) = \begin{cases}0&\mathrm{\ if\ } 0
This function is not constant but has derivative $0$ everywhere in domain.I know it is pretty much possible because of the domain he chose, but what is special there in this domain which makes this happen.
Can anybody give some other examples not of this form (which I gave above) having derivative $0$ without function being constant.