Derivative and constant function

Solution 1:

There is an everywhere differentiable non-constant function such that the set $Z=\{x: f'(x) = 0 \}$ is dense. The following paper gives an example of such a function:

Y. Katznelson and Karl Stromberg. Everywhere Differentiable, Nowhere Monotone, Functions. The American Mathematical Monthly , vol. 81, no. 4 (Apr., 1974), pp. 349-354.

According to this paper:

Examples of such functions are seldom given, or even mentioned, in books on real analysis. The first explicit construction of such a function was given by Kopcke (1889). An example due to Pereno (1897) is reproduced in [1], pp. 412-421.

...

[1] E. W. Hobson, Theory of Functions of a Real Variable II, Dover, New York, 1957

Solution 2:

No you can't (but I don't have the example).

Look at this answer, where it is stated that the set of discontinuities of a derivative can be dense and have several other properties.