18. (2003 Tianjin High School Mathematics Competition) Given the function $f(x)=x^{2}+x-2$.
(1) Try to find the expression for the function $g(x)=\frac{|f(x)|-f(x)}{2}$;
(2) If $a>0$, the line $y=a x+b$ intersects the curve $y=g(x)$ at three different points, determine the relationship between $a$ and $b$, and draw a diagram to represent the region where the point $(a, b)$ lies.
18. (1) \( g(x) = \begin{cases} 
0 & (x \leqslant -2 \text{ or } x \geqslant 1), \\ 
-x^2 - x + 2 & (-2 < x < 1) 
\end{cases} \)

When \( a > 0 \), the line \( y = ax + b \) intersects the curve \( y = g(x) \) at three different points if and only if the line intersects the curve in the interval \( -2 < x < 1 \).

To satisfy this condition, we need:
\[
\begin{cases}
\varphi(-2) > 0, \\
\varphi(1) > 0, \\
a > 0,
\end{cases}
\]
which is equivalent to:
\[
\begin{cases}
b > 2a, \\
b > 0, \\
a > 0.
\end{cases}
\]

Thus, the region where the point \((a, b)\) lies is the shaded area in Figure 9-5 (excluding the boundaries).