I've read through a few of the other posts on the site, but I still don't quite understand.
Suppose $f : A \to B$, for $A = \{a, b, c\}$ and $B = \{1, 2, 3, 4\}$, and suppose that we define the function $f(x)$, for some $x \in A$, as:
$f(a) = 1$
$f(b) = 2$
$f(c) = 3$
That is, the element $4$ in the codomain remains unmapped/unassigned to any element in the codomain. While the function is one-to-one, it is not surjective, and thereby is not bijective.
The inverse, if we were to write one up, would look like so:
$f(1) = a$
$f(2) = b$
$f(3) = c$
$f(4) = undefined$
Now, what I don't understand is why this is a problem. Why did the original function have to be surjective? Consider the familiar function $f : R \to R$ such that $f(x) = \frac{1}{x}$. This function, while one-to-one, is not onto, just as with my example above. However, we can still find an inverse:
$y = f(x) = \frac{1}{x}$
$xy = 1$
$x = \frac{1}{y}$
$y = \frac{1}{x}$
$f^{-1}(x) = \frac{1}{x}$