A function $f$ from $X$ to $S$ is a subset of $X\times S$ such that if $\langle x,s\rangle,\langle x,t\rangle\in f$, then $s=t$. If $X=\varnothing$, then $X\times S=\varnothing\times S=\varnothing$, and the only subset of $X\times S$ in that case is $\varnothing$: $\varnothing$ is the only function from $\varnothing$ to $S$, no matter what set $S$ is.
I’ve really already answered your second question as well: $F\subseteq X\times S$ is a function iff for each $x\in X$ there is at most one $s\in S$ such that $\langle x,s\rangle\in F$. If you replace at most one with exactly one, you ensure that the domain of $F$ is all of $X$. Another way to describe this is in terms of slices of the $X\times S$ plane. For each $x\in X$ let $S_x=\{x\}\times S$, the vertical slice at $x$. Then $F$ is a function if $|F\cap S_x|\le 1$ for each $x\in X$. (In elementary texts this is sometimes called the vertical line test.)