It is a fact that : two sets A and B are equinumerous iff there is at least a bijection from A to B.
From this we can infer that
(1) equinumericity implies existence of at least one bijection
and that
(2) existence of at least one bijection implies equinumericity.
But can we draw from what preceeds that :
the equinumericity of domain and range of f implies that f is a bijection?
The real valued function of a real variable that maps $x$ to $x^2$ has range equicardinal with its domain but is not a bijection.
If the domain $D$ of a function $f$ is a finite set and $D$ and its range $f(D)$ are equicardinal then $f$ is a bijection between $D$ and the range. The codomain can be larger, of course: consider the injection from $[ 1]$ to $[1,2]$