# Exerise on decreasing function

Let $a,b\in\mathbb{R}$ be such that $a\leq b$. Let $f:[a,b]\rightarrow\mathbb{R}$ be a continuous function. Assume that for every $a<u\leq b$, there exists $\varepsilon>0$ such that for all $x\in(u-\varepsilon,u)\bigcap[a,b]$ we have $$f(x)>f(u).$$ Prove that $f$ is decreasing, i.e., $$x_1<x_2\Rightarrow f(x_1)>f(x_2).$$ Give a counterexample if we violate the continuity assumption of $f$.

Assume there exists $x_{1}<x_{2}$ with $f(x_{1})\leq f(x_{2})$. Then there exists $x_{1}<x_{3}<x_{2}$ with $f(x_{3})>f(x_{2})$ (consider $u=x_{2}$) and then $f$ attains maximum at $x_{4}\in (x_{1}, x_{2})$ (Since $f$ is continuous and $[x_{1}, x_{2}]$ is compact, it attains maximum on $[x_{1}, x_{2}]$ not at $x_{1}, x_{2}$). This leads to contradiction. (consider $u=x_{4}$)

• This one doesn't use continuity, cannot be right – JukesOnYou Jul 1 '16 at 15:54
• Thank you for your nice solution. – Blind Jul 1 '16 at 15:55
• @JukesOnYou "attains maximum" - this uses continuity – Hagen von Eitzen Jul 1 '16 at 15:55
• JukesOnYou: He uses continuity assumption to obtain maximum. – Blind Jul 1 '16 at 15:56
• @Blind Consider $f:[0,2]\to\mathbb{R}$ with $f(x)=-x$ for $0\leq x\leq 1$, $f(x)=2-x$ for $1<x\leq 2$. – Seewoo Lee Jul 1 '16 at 16:10

Assume otherwise, i.e., we have $a\le x_1<x_2\le b$ with $f(x_1)\le f(x_2)$. In fact, we may even assume $f(x_1)<f(x_2)$ as otherwise we just decrease $x_2$ slightly and use the given property of $f$. Let $x_3=\inf\{\,x\in [x_1,x_2]\mid f(x)\ge f(x_2)\,\}$. Then $f(x_3)\ge f(x_2)$ by continuity. Hence $x_1<x_3\le x_2$. By assumption, there exists $\epsilon>0$ such that $f(x)>f(x_3)$ for all $x\in(x_3-\epsilon,x_3)\cap [x_1,x_3]$, i.e., $x_3$ cannot really be the infimum.

We give a direct proof based on the idea of See-Woo Lee.

Let $x_1,x_2\in[a,b]$ be such that $x_1<x_2$. Since $f$ is continuous and $[x_1,x_2]$ is compact, there exists $x_0,x_1\in[x_1,x_2]$ such that $$f(x_\text{max})=\max_{x\in[x_1,x_2]}f(x).$$ Since $x_1<x_2$ and the assumption of $f$ we have $f(x_{\max})>f(x_2)$. Again the assumption of $f$ implies $x_\text{max}=x_1$. Hence, $f(x_1)>f(x_2)$.

Remark.

1) In the above proof we can replace the continuity of $f$ by the upper lower continuity of $f$.

2) We cannot violate the continuity assumption. Indeed, consider the function $$f(x)= \begin{cases} -x \quad \text{if} \quad x\ne 0,\\ -1 \quad \text{if} \quad x= 0. \end{cases}$$ Here $f$ is not upper semicontinuous.