If $\displaystyle f:A \rightarrow B$ is surjective and A is finite, then B is finite. True or false?

I think this is false but my book says it is true.

I think its false by counter-example:

Let A=$\displaystyle (-\frac{\pi}{2},\frac{\pi}{2})$ and let f(x) = tan(x). Then B is infinite?

Am I wrong about this?