Question 2
Define the function $f:(0,1) \rightarrow(0,1)$ by
$$
f(x)= \begin{cases}x+\frac{1}{2} & \text { if } x\lt \frac{1}{2} \\ x^{2} & \text { if } x \geqslant \frac{1}{2}\end{cases}
$$
Let $a$ and $b$ be two real numbers such that $0\lt a\lt b\lt 1$. We define the sequences $a_{n}$ and $b_{n}$ by $a_{0}=a, b_{0}=b$, and $a_{n}=f\left(a_{n-1}\right), b_{n}=f\left(b_{n-1}\right)$ for $n\gt 0$. Show that there exists a positive integer $n$ such that
$$
\left(a_{n}-a_{n-1}\right)\left(b_{n}-b_{n-1}\right)\lt 0 .
$$
$$
f(x)= \begin{cases}x+\frac{1}{2} & \text { if } x\lt \frac{1}{2} \\ x^{2} & \text { if } x \geqslant \frac{1}{2}\end{cases}
$$
Let $a$ and $b$ be two real numbers such that $0\lt a\lt b\lt 1$. We define the sequences $a_{n}$ and $b_{n}$ by $a_{0}=a, b_{0}=b$, and $a_{n}=f\left(a_{n-1}\right), b_{n}=f\left(b_{n-1}\right)$ for $n\gt 0$. Show that there exists a positive integer $n$ such that
$$
\left(a_{n}-a_{n-1}\right)\left(b_{n}-b_{n-1}\right)\lt 0 .
$$