12. The function $f_{n}(x)(n=1,2,3, \cdots)$ is defined as follows: $f_{1}(x)=4\left(x-x^{2}\right)(0 \leqslant x \leqslant 1)$, $f_{n+1}(x)=f_{n}\left(f_{1}(x)\right)(n=1,2, \cdots)$. Let the number of $x$ in $[0,1]$ that make $f_{n}(x)$ reach its maximum value be $a_{n}$, and the number of $x$ that make $f_{n}(x)$ reach its minimum value be $b_{n}$. Try to express $a_{n}$ and $b_{n}$ in terms of $n$.
12. $y=f_{1}(x)$ reaches its maximum value 1 at $x=\frac{1}{2}$, and its minimum value 0 at $x=0,1$. Thus, $a_{1}=1, b_{1}=2$, and for any positive integer $n$, $x=0,1$ are always the minimum points of $f_{n}(x)$. Therefore, the number of maximum points of $f_{n}(x)$ in $0<x \leqslant 1$ is $a_{n}$. Assuming the number of minimum points of $f_{n}(x)$ in $0<x \leqslant 1$ is also $a_{n}$, then the number of maximum points and minimum points of $f_{n}(x)$ in $0 \leqslant x<1$ is also $a_{n}$. Now consider $f_{n+1}(x)=f_{n}\left(f_{1}(x)\right)=f_{n}(y)$, where $y=f_{1}(x)$. When $0<x \leqslant \frac{1}{2}$, $0<y \leqslant 1$ is monotonically increasing, making $y$ take the $a_{n}$ maximum points and $a_{n}$ minimum points of $f_{n}(y)$, and the $x \in \left(0, \frac{1}{2}\right]$ that make $y$ take these points are also $a_{n}$ each; when $\frac{1}{2}<x \leqslant 1$, $0 \leqslant y<1$ is monotonically decreasing, making $y$ take the $a_{n}$ maximum points and $a_{n}$ minimum points of $f_{n}(y)$, and the $x \in \left(\frac{1}{2}, 1\right]$ that make $y$ take these points are also $a_{n}$ each. Therefore, the number of maximum points and minimum points of $f_{n+1}(x)$ in $(0,1]$ is $a_{n+1}=2 a_{n}$. Thus, $a_{n}=2^{n-1}, b_{n}=a_{n}+1=2^{n-1}+1$.