Consider a disconnected domain (say, union of a few open balls in R^n), and f being constant in each connected component, but having different values in each ball. The differential is indeed everywhere 0 in the entire domain.
There is a similar thing in graph theory, where the kernel of the incidence matrix counts how many connected components a graph has.
This happens in engineering and software all the time. Time and time again, issues being resolved usually revolves around clarifying assumptions.