How the proof proceeds depends on how you define "countable". A nonempty set
is countable if either:
1) there exists a one-to-one function
or
2) there exists an onto function
It turns out these are equivalent, so go with the second.
Since is countable there exists an onto function , and by hypothesis there is an onto function . The composition is onto, so that B
B is countable.