TITLE: What are local homomorphisms, geometrically?
QUESTION [6 upvotes]: For want of a better name, let us say that a ring homomorphism $f : A \to B$ is local if it (preserves and) reflects invertibility, i.e. $f (a)$ is invertible in $B$ (if and) only if $a$ is invertible in $A$. (A local ring homomorphism is then a local homomorphism in this sense whose codomain is a local ring; note that the domain is then automatically a local ring.)
Question. Is there a property of morphism $\operatorname{Spec} f : \operatorname{Spec} B \to \operatorname{Spec} A$, expressible geometrically, that is equivalent to the property of $f : A \to B$ being local?

In view of the early answers given, here is a conjecture:
Conjecture. $f : A \to B$ is a local homomorphism if and only if the set-theoretic image of $\operatorname{Spec} f : \operatorname{Spec} B \to \operatorname{Spec} A$ contains all the closed points (of $\operatorname{Spec} A$).
The conjecture is true if $B$ is a local ring, and also when $f : A \to B$ is surjective, as shown by @zcn below. In the general case, the "if" direction holds: indeed, if every maximal ideal of $A$ is the preimage of some ideal of $B$, then $f : A \to B$ preserves non-units, hence is local. What about the converse?

REPLY [2 votes]: A trivial reformulation is the following: A morphism of affine schemes $X \to Y$ is local when $Y$ is the only principal open subscheme of $Y$ through which $X \to Y$ factors.
(It does not follow that $Y$ is the only open subscheme of $Y$ through which $X \to Y$ factors.)