Example 2 Given that $\triangle XYZ$ is an isosceles right triangle with legs of length 1 $\left(\angle Z=90^{\circ}\right)$, and its three vertices are on the three sides of the isosceles right triangle $\triangle ABC\left(\angle C=90^{\circ}\right)$. Find the maximum possible length of the legs of $\triangle ABC$.
(2002, Shanghai Junior High School Mathematics Competition)
[Analysis] Obviously, this problem should be discussed in two cases: when point $Z$ is on the hypotenuse of $\triangle ABC$ and when it is on the legs of $\triangle ABC$. The solution should involve geometric methods and algebraic methods (introducing variables, using knowledge of equations and functions).
(1) As shown in Figure 3, if vertex $Z$ is on the hypotenuse $AB$, take the midpoint $M$ of $XY$, and connect $CM$, $ZM$, $CZ$, and draw the altitude $CN$ from $C$ to $AB$.
Then $C N \leqslant C Z \leqslant C M + M Z$
$$
=\frac{1}{2} X Y + \frac{1}{2} X Y = X Y = \sqrt{2} \text{. }
$$

Thus, $C A = \sqrt{2} C N \leqslant 2$.
(2) As shown in Figure 4, if vertex $Z$ is on the right-angle side $CA$ (or $CB$), by symmetry, assume point $Z$ is on $CA$, and let $CX = x$, $CZ = y$, and draw $YH \perp CA$ at point $H$.
It is easy to prove that $\triangle Z Y H \cong \triangle X Z C$.
Then $HZ = CX = x$, $HY = CZ = y$.
Therefore, $\triangle A H Y$ is an isosceles right triangle, so $A H = y$.
Let $AC = b \geqslant 0$. Then
$$
2 y + x = b \Rightarrow x = b - 2 y \text{. }
$$

In $\triangle X Z C$, by the Pythagorean theorem, we have
$$
\begin{array}{l}
y^{2} + (b - 2 y)^{2} = 1^{2} \\
\Rightarrow 5 y^{2} - 4 b y + b^{2} - 1 = 0 .
\end{array}
$$

By $\Delta = 16 b^{2} - 20 (b^{2} - 1) \geqslant 0$, we get $b \leqslant \sqrt{5}$.
When $b = \sqrt{5}$, $y = \frac{2 \sqrt{5}}{5}$, $x = \frac{\sqrt{5}}{5}$.
Combining (1) and (2), the maximum possible length of the right-angle side of $\triangle ABC$ is $\sqrt{5}$.
2 Inscribed triangles in quadrilaterals