Given the sets $A=\{(x, y) \mid y=a x+2\}, B=\{(x, y) \mid y=| x+1 |\}$, and $A \cap B$ is a singleton set, find the range of the real number $a$.

The above text translated into English, please retain the original text's line breaks and format, and output the translation result directly.
We draw the graphs of the functions $y=a x+2$ and $y=|x+1|$ in Figure 1-1. By the problem statement, $A \cap B$ is a singleton set, so their graphs intersect at only one point. From the graph, we can see that the range of values for $a$ is $(-\infty,-1] \cup[1,+\infty)$.