# Finding local min or max points for dirichlet if they exist.

$$D(x)= \begin{cases} 1 & \text{if}\ x \in\mathbb Q\\ 0 & \text{if}\ x \notin\mathbb Q \end{cases}$$ I have to somehow prove that for $\forall x, x_0 \in D$, $f(x)\le f(x_0)$ or $f(x)\ge f(x_0)$.

I know the function isn't continuous anywhere, but where I'm confused is whether or not the function is differentiable, and whether or not it could have local max or min values

$\lim \limits_{h \to 0} \frac{f(x_0+h)-f(x_0)}{h}$ gives me $\frac00$.

• Hint 1. What value can $D(x_0)$ be for any chosen $x_0$? Hint 2. What value can $D(x)$ be for any $x\ne x_0$? ...and for $x=x_0$...? – CiaPan May 27 '16 at 20:57
• How can $x \in D$? $D$ is a function, not a set. – marty cohen May 27 '16 at 20:59

For every $x_0$ in Q, $D(x_0)= 1$, and let $x_1 \in Q$. then $D(x_1)$=0.
Therefore, $D(x_0)\gt$ $D(x_1)$, therefore every $x_0$ we take is a local maximum, and it's the same for $D(x_0)\lt$ $D(x_1)$, where every $x_1$ will be a local minimum.
As written the condition doesn't make much sense, I assume that what you have to show is $$\forall x_0\in\mathbb R: (\forall x\in\mathbb R: f(x)\leq f(x_0))\lor (\forall x\in\mathbb R: f(x)\geq f(x_0))$$
If that is the case, you could consider the possible values of $f(x_0)$ and show the statement for all of the possible values independently.