Yes, the function is injective. One way to see this is to make the definition more explicit:
A function $f:X\rightarrow Y$ is injective if
$$\forall x \in X, \forall y \in X, (x \neq y \Rightarrow f(x) \neq f(y))$$
or equivalently (the contrapositive) if
$$\forall x \in X, \forall y\in X, (f(x) = f(y) \Rightarrow x = y).$$
Whenever $S$ is an empty set, the statement $\forall x \in S, \ldots$ is always true— vacuously true. Such a statement says "Whenever you can find points in $S$ such that …", and because you can't find any points in an empty set $S$, the statement doesn't need to be checked for any points; it automatically holds.
The definition of injectivity is like this when the domain of $f$ is empty. It says "For any two points in the domain, …". The domain is empty so the statement doesn't need to be checked for any points; it automatically holds.
$f:\varnothing\rightarrow Y$ is injective.