10. Let the function $f:(0,1) \rightarrow \mathbf{R}$ be defined as
$$
f(x)=\left\{\begin{array}{l}
x, \text { when } x \text { is irrational, } \\
\frac{p+1}{q}, \text { when } x=\frac{p}{q},(p, q)=1,0<p<q
\end{array}\right.
$$

Find the maximum value of $f(x)$ on the interval $\left(\frac{7}{8}, \frac{8}{9}\right)$.
10. It is evident that $f\left(\frac{15}{17}\right)=\frac{16}{17}$, and $\frac{15}{17} \in\left(\frac{7}{8}, \frac{8}{9}\right)$. We will now prove that $\frac{16}{17}$ is the maximum value of $f(x)$.
(1) If $x$ is an irrational number, and $x \in\left(\frac{7}{8}, \frac{8}{9}\right)$, then by definition, $f(x)=x<\frac{8}{9}<\frac{16}{17}$;
(2) If $x$ is a rational number, and $x \in\left(\frac{7}{8}, \frac{8}{9}\right)$, let $x=\frac{p}{q}((p, q)=1)$, and $0<p<q, p, q$ are positive integers, then $\frac{7}{8}<\frac{p}{q}<\frac{8}{9}, 7 q<8 p, 9 p<8 q$, by the discreteness of positive integers, we have $7 q+1 \leqslant 8 p, 9 p+1 \leqslant 8 q .7 q+1 \leqslant$ $8 p \leqslant 8 \cdot \frac{8 q-1}{9}$, thus $q \geqslant 17$. Therefore, $f(x)=f\left(\frac{p}{q}\right)=\frac{p+1}{q} \leqslant \frac{\frac{8 q-1}{9}+1}{q}=\frac{8}{9}+\frac{8}{9 q} \leqslant \frac{8}{9}+\frac{8}{9 \times 17}$ $=\frac{16}{17}$.