For a function \(f:A\to B\), each element of \(A\) may be sent to any element of \(B\).
Here \(|A|=2\), \(|B|=3\). For the first element of \(A\) there are \(3\) choices; for the second, again \(3\) choices (independent).
Thus total functions \(=3\times3=3^{2}=9\).