Define the function $f : (0, 1) \to (0, 1)$ by
$$
f(x) = \begin{cases}
x + \frac12 & \text{if } x < \frac12 \text{,} \\
x^2 & \text{if } x \geq \frac12 \text{.}
\end{cases}
$$
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 \text{.} $$
\begin{flushright}\emph{(Denmark)}\end{flushright}