Counter-example : Take $A=\{1\}$ and $B=\{2\}.$ Then under $\varnothing$, the element $1$ of $A$ does not have an image in $B$. Thus $\varnothing : A \to B$ is not a function.
I seek feedback about my approach whether it is right or wrong.
I know that $\varnothing$ is a function when $A$ is empty. Otherwise it is not. I have gone through this and this, it helped me to understand the cases when $A$ is empty and when $B$ is empty but $A$ is non-empty.
EDIT : The definition of function that I am using is as follows,
A relation $F$ from a set $A$ to set $B$ is said to be a function if and only if-
For every $x \in A$, $\exists y \in B$ such that $(x,y) \in F$,
If $(x,y) \in F$ and $(x,z) \in F$, then $y=z$.