I believe the following holds (by an exercise in Atiyah-Macdonald (AM)): Let $B:=A \otimes A$ and let $I:=ker(m)$ be the kernel of the multiplication map.
It follows $V(I) \cup V(I)^c=S:=Spec(B)$. If $V(I)^c=V(J)$ is closed it follows by AM Exercise I.15 that
$$V(I) \cup V(J)= V(I\cap J)=S$$
hence $I \cap J \subseteq \mathfrak{p}$ for all prime ideals $\mathfrak{p}\subseteq B$,
hence $I\cap J \subseteq nil(B)$. Since $V(I) \cap V(J)=V(I+J)=\emptyset$ it follows
$I+J=(1)$ is the unit ideal. Hence if $B$ is a domain it follows $I\cap J =(0)$ and $I+J =(1)$ hence there is by the Chinese remainder theorem an isomorphism
$$ B:=A\otimes A \cong A\otimes A/I \oplus A\otimes A/J \cong A \oplus A\otimes A/J.$$
Hence
$$S:=Spec(A\otimes A) \cong Spec(A) \cup Spec(A\otimes A/J):=S_1 \cup S_2$$
is a disjoint union. It seems the diagonal map $\Delta$ is an open immersion in this case, since $Spec(A)\cong S_1 \subseteq Spec(B)$ is an open subscheme. The two schemes $S_1:=Spec(A),S_2:=Spec(B/J)$ are open and closed in $S$.
Question: "If we assume that $V(I)$ is an open subscheme, then is $f$ an open immersion?"
Answer: If the product $S$ is a reduced scheme it seems the following holds:
Lemma. If $V(I)$ is an open subscheme it follows the diagonal map $\Delta$ is an open immersion.
Proof. This holds since $nil(B)=0$ and hence by the above argument it follows the diagonal map $\Delta$ induces an isomorphism between $Spec(A)$ and the image $\Delta(Spec(A))\cong S_1 \subseteq S$.
Example. In general if $S:=Spec(A)$ is a reduced affine scheme and $Z:=V(I)$ is open and closed it follows $V(I)^c=V(J)$ and $I \cap J =(0), I+J=(1)$ hence by the Chinese remainder theorem we get a direct sum decomposition
$$A \cong A/I \oplus A/J$$
and a disjoint union of schemes
$$Spec(A) \cong Spec(A/I) \cup Spec(A/J):=V(I) \cup V(I)^c.$$
Conversely if $A \cong A_1 \oplus A_2$ there are ideals $I_i\subseteq A$
with $A/I_i \cong A_i$ and $I_1 \cap I_2=(0), I_1+I_2=(1).$ The subschemes $Spec(A_i)\subseteq Spec(A)$ are open and closed.