[Math] maxima and minima piecewise function

functionsoptimization

I'm exercising on maxima and minima, I think I got the point of global and local extremes but then I find this piecewise function where my teacher says that the right answer is "c". I thought the right answer was "b". Could you help me understand why,please.

Let $f(x)=
\begin{cases}
1+x, &\text{if }x\lt 0\\
0,& \text{if }x=0\\
1-x,&\text{if }x\gt0
\end{cases}
$

Then:

a) f has a local, but not global, minimum point

b) f has a global minimum point

c) f has a local, but not global, maximum point

d) f has a global maximum point

Thank you

Best Answer

To answer this question one has to review the definitions. Specialized to this case these definitions read: A function $f: \mathbb R \to \mathbb R$ has a global maximum point at $x^∗ \in \mathbb R$ if $f(x^∗) \geq f(x)$ for all $x$ in $\mathbb R$. Similarly, $f$ has a global minimum point at $x^∗ \in \mathbb R$ if $f(x^∗) \leq f(x)$ for all $x$ in $\mathbb R$.

Clearly, for the given function $f$ the following holds: for every $x^∗ \in \mathbb R$ there exists $x \in \mathbb R$ such that $f(x^*) \lt f(x)$. This is the negation of the definition of the global maximum. So, $f$ does not have a global maximum. Similarly, $f$ does not have a global minimum.

A function $f : \mathbb R \to \mathbb R$ is said to have a local maximum point at the point $x^∗ \in \mathbb R$ if there exists some $\epsilon \gt 0$ such that $f(x^∗) \geq f(x)$ for all $x \in (x^*-\epsilon, x^*+\epsilon)$. Similarly, $f : \mathbb R \to \mathbb R$ is said to have a local minimum point at the point $x^∗ \in \mathbb R$ if there exists some $\epsilon \gt 0$ such that $f(x^∗) \leq f(x)$ for all $x \in (x^*-\epsilon, x^*+\epsilon)$.

It is clear that for $\epsilon = 1/2$ we have $f(0) \leq f(x)$ for all $x \in (-1/2,1/2)$. Therefore, $f$ has a local minimum at $x^* = 0$.

It is a good exercise to state the negation of the statement: "$f$ has a local maximum" and prove it for the given $f$.

Finally, the correct answer is (a).

A graph is always helpful:

enter image description here

Related Question