3. For $a, b \in \mathbf{R}$, let
$$
\max \{a, b\}=\left\{\begin{array}{ll}
a, & a \geqslant b ; \\
b, & a<b,
\end{array}\right.
$$

The function $f(x)=\max \left\{2^{-x},-|x-1|+2\right\}$. Then the equation $f(x)=a$ has three roots, the range of the real number $a$ is $\qquad$
3. $(1,2)$.

In the same Cartesian coordinate system, draw the graphs of $y=2^{-x}$ and $y=-|x-1|+2$ as shown in Figure 4.
$$
\begin{array}{l} 
\text { Let } f(x)=\max \left\{2^{-x},\right.-|x-1|+2\} \\
=\left\{\begin{array}{ll}
2^{-x}, & 2^{-x} \geqslant-|x-1|+2 ; \\
-|x-1|+2, & 2^{-x}<-|x-1|+2,
\end{array}\right.
\end{array}
$$

From this, the graph of $f(x)$ is the solid part in Figure 4.
Since the equation $f(x)=a$ has three roots, the function $y=f(x)$ intersects the line $y=a$ at three different points.

From Figure 4, it is clear that when $1<a<2$, the function $y=f(x)$ intersects the line $y=a$ at exactly three different points.