Example 1. If $|x-1|+|y-1|=1$, find the extremum of $x^{2}+y^{2}$.

 untranslated text remains in its original format and line breaks are preserved.
Solve $|x-1|+|y-1|=1$ whose graph is shown in Figure 1. Among the family of circles centered at the origin that have common points with the graph of $|x-1|+|y-1|=1$, the radius of the circle passing through point $A$ is $\frac{\sqrt{2}}{2}$, which is the minimum, and the radius of the circle passing through point $B$ is $\sqrt{5}$, which is the maximum.
Therefore, the minimum value of $x^{2}+y^{2}$ is $\left(\frac{\sqrt{2}}{2}\right)^{2}=\frac{1}{2}$, and the maximum value of $x^{2}+y^{2}$ is $(\sqrt{5})^{2}=5$.