Example 8 Find the minimum value of the function
$$
f(x)=\max \left\{|x+1|,\left|x^{2}-5\right| \right\}
$$

and find the value of the independent variable $x$ when $f(x)$ takes the minimum value.
Solve As shown in Figure 1, in the same Cartesian coordinate system, draw the graphs of $f_{1}(x)=|x+1|$ and $f_{2}(x)=\left|x^{2}-5\right|$. The two graphs intersect at four points, $A$, $B$, $C$, and $D$, whose x-coordinates can be obtained by solving the equation $|x+1|=\left|x^{2}-5\right|$.
Removing the absolute value signs gives
$$
x+1=x^{2}-5 \text { or } x+1=5-x^{2} \text {. }
$$

Solving these, we get $x_{1}=3, x_{2}=-2$,
$$
x_{3}=\frac{-1+\sqrt{17}}{2}, x_{4}=\frac{-1-\sqrt{17}}{2} \text {. }
$$

From Figure 1, it is clear that the x-coordinates of points $A$, $B$, $C$, and $D$ are $\frac{-1-\sqrt{17}}{2},-2, \frac{-1+\sqrt{17}}{2}, 3$ respectively.

According to the definition of $f(x)$, its graph is shown by the solid line in the figure, and the y-coordinate of point $B$ is the minimum value of the function $f(x)$, at which $f(-2)=1$.