<s>[INST] Define the function $f:(0,1)\to (0,1)$ 
Define the function $f:(0,1)\to (0,1)$ by $$ \displaystyle f(x) = \left\{ \begin{array}{lr} x+\frac 12 & \text{if}\ \  x < \frac 12\\ x^2 & \text{if}\ \  x \ge \frac 12 \end{array} \right.$$ Let $a$ and $b$ be two real numbers such that $0 < a < b < 1$. We define the sequences $a_n$ and $b_n$ by $a_0 = a, b_0 = b$, and $a_n = f( a_{n -1})$, $b_n = f (b_{n -1} )$ for $n > 0$. Show that there exists a positive integer $n$ such that $$(a_n - a_{n-1})(b_n-b_{n-1})<0.$$

it's just for sharing a new ideas, thanks:)
 [/INST] My solution: 
Suppose, on the contrary, that $(a_n-a_{n-1})(b_n-b_{n-1}) \geq 0$ for all $n\in \mathbb{N}$.
Then, $a_n \geq a_{n-1}$ and $b_n \geq b_{n-1}$ or $a_n \leq a_{n-1}$ and $b_n \leq b_{n-1}$.
It is easy to prove that $a_{n-1}<\frac{1}{2}$ and $b_{n-1}<\frac{1}{2}$ or $a_{n-1}\geq\frac{1}{2}$ and $b_{n-1}\geq\frac{1}{2}$.
Lemma $1$: $a_n \geq \frac{1}{2}$ for infinitely many $n$.
Proof: Just note that if $a_n < \frac{1}{2}$, then $a_{n+1} \geq \frac{1}{2}$.
Lemma $2$4: $a_n \geq \frac{3}{4}$ and $b_n \geq \frac{3}{4}$ are both true for infinitely many $n$.
Proof: Use lemma $1$ and our initial assumption.
Lemma $3$: Let $g(n)=b_n-a_n$. Then, $g(n)>\frac{1}{2}$ for some $n$.
Proof: Note that either $g(n) \geq g(n-1)$ or $g(n) \geq \frac{3}{2} g(n-1)$, depending on which side of $\frac{1}{2}$ $a_n$ and $b_n$ are on. Use lemma 2 to show that there exists a $k$ such that $g(k) \geq (\frac{3}{2})^{\lceil log_\frac{3}{2} \frac{1}{2g(1)}  \rceil} g(1) > \frac{1}{2}$. 
We get a contradiction to our initial assumption since $a_n$ and $b_n$ are on the same side of $\frac{1}{2}$ and are between $0$ and $1.$ Thus, the problem is proved.
And I hope to see more solutions, thanks
</s>