A function f is defined such that an element in the domain of f gets mapped to exactly one element in the codomain of f.
In other words, f(a) = f(b) if and only if a = b.
The statement in red is not true.
Consider this example:
and
Is it clear that ?
But is it true that ?