The following are the only possibilities:
i) f(0)=f(1)=f(2)
ii) f(0)<f(1)=f(2)
iii)f(0)=f(1)<f(2)
iv)f(0)<f(1)<f(2)
For iv) we just need to select 3 numbers from B and arrange them in ascending order. This could be done in 8C3 ways.
For ii) and iii), we similarly have 8C2 ways.
For i) there are 8C1 ways.
Hence, the total number of required functions = 8C3 + 2 8C2 + 8C1 = 120 = 10C3