[Math] Finding all local maximum and minimum points of function

calculusderivativesgraphing-functions

If $$f(x) = \left\{\begin{array}{lr} x, \ \text {if x is rational}, \\ 0, \ \text {if x is irrational}, \end{array}\right. $$

Find all local maximum and minimum points of $f(x)$.

How can I go about doing this, since it's not a normal kind of function where I can differentiate and find the critical points?

Best Answer

If $x$ is rational, so $f(x)=x$, are there values $y$, as close as you like to $x$, with $f(y)>f(x)$? Are there values $z$, as close as you like to $x$, with $f(z)<f(x)$?.
Then ask the same questions for irrational $x$.

Related Question