No. If $A=\varnothing$, then certainly any statement of the form "for all $x\in A$, ____" is true, so any subset of $A\times B=\varnothing\times B=\varnothing$ is a function. Thus, consider the case when $A\neq\varnothing$, i.e. $\exists a\in A$ for some $a$. If one has proven that "for all $x\in A$, there exists a unique $y\in B$ such that $(x,y)\in f$", then in particular, there exists a unique $b\in B$ such that $(a,b)\in f$. For our purposes, we don't care about uniqueness: the fact remains that we have proven that there does exist some $b\in B$, thereby demonstrating that $B\neq\varnothing$.
Thus, proving that "for all $x\in A$, there exists a unique $y\in B$ such that $(x,y)\in f$" does indeed suffice to prove that $f$ is a function: if $A$ is empty, there is no problem, and if $A$ is non-empty, then we can deduce that $B$ is non-empty. So we don't need to prove that "$A$ is empty or $B$ is non-empty" separately.