Induction proof: if $n\in\mathbb{N}$, $f:I_n\to B$, and $f$ is onto, then $B$ is finite and $|B|\le n$ 
Prove that if $n\in\mathbb{N}$, $f:I_n\to B$, and $f$ is onto, then $B$ is finite and $|B|\le n$.

Attempt at a proof:
We use induction
Base case: When $n=0, I_0=\varnothing$ and since $f$ is onto $B=\varnothing$.
Inductive step:
Suppose $n\in\mathbb{N}$, Now suppose $g:I_{n+1}\to B$ is onto, then there is a $b\in I_{n+1}$ that fails to be in $I_{n}$, so it must be the case that $g(b)=g(a)$ such that $b\neq a$ for arbitrary $a\in I_{n+1}$ since $g$ is onto,  hence $g$ fails to be one-to-one. We construct a set $I_{n}'=I_{n+1}\setminus\{b\}$ and show that $f:I_{n}'\to B$ is one-to-one and onto.
Is my approach correct?  I'm particularly worried about where to include the induction hypothesis since this is after all a proof by induction. My goal is to prove that $f$ is one-to-one, forget the Cantor-Bernstein-Schroder theorem for now.
 A: I guess, $I_n$ stands for a canonical $n$-element set, say $\{1,2,3,\dots,n\}$.
I can't really understand your try for the induction step, however it tastes something like that...
Let $f:I_{n+1}\to B$ surjective, and consider its restriction to $I_n$, $\ f':=f|_{I_n}$. If it is still surjective, we are ready by induction hypothesis $|B|\le n<n+1$.
We are left with the case when $f(n+1)\in B$ differs from all $f(k),\ k\le n$. Now take $B':=B\setminus\{f(n+1)\}$ and apply the induction hypothesis to $f':I_n\to B'$. So that $|B'|\le n$ and $B=B'\cup\{f(n+1)\}$.
A: Without induction: let $\;f:K\to B\;$ be a surjective sets map . Now, $\;\forall\,b\in B\;$ we choose one unique
$$k_b\in K\;\;s.t.\;\;f(k_b)=b$$
We're simply choosing an element in each fiber of each element in $\;B\;$ . One can use AC if wanted as we don't know a priori what the cardinality of $\;B\;$ is, though I think this can be avoided as it looks to me as overkill...anyway, now define
$$K':=\{k_b\in K\;;\;b\in B\}\;,\;\;g:B\to K'\;,\;\;g(b):=k_b$$
Then, clearly $\;g\;$ is injective and thus $\;|B|\le |K'|\le |K|<\infty\;$  , since $\;K'\subset K\;$
