Let $A$ and $B$ be sets and let $f:A \to B$ be a function.
Assume $f$ is injective. Let $y \in B$. There are two cases to consider. If there exists an $x \in A$ such that $f(x) = y$, then $x$ is unique by the definition of injective. If there does not exist an $x \in A$ such that f(x) = y, then the predicate is still satisfied. Since the predicate is satisfied in either case, it follows that for all $y \in B$ there exists at most one $x \in A$ such that $f(x)=y$
Conversely, Assume for all $y \in B$ there exists at most one $x \in A$ such that $f(x)=y$. Suppose $x,x' \in A$ and $f(x) = f(x')$. Since, $f(x)$ and $f(x') \in B$ and $f(x) = f(x')$, it follows that $x=x'$, by our assumption. Thus, $f$ is injective.
Therefore,$f$ is invective if and only if for all $y \in B$ there exists at most one $x \in A$ such that $f(x)=y$ is true.
Please critique this proof and give any advice. Thank you!