Let $A$ be a commutative unital $R$-algebra and consider the multiplication map $m:A\otimes_R A\rightarrow A$ given by $m(a\otimes b) = ab$ with kernel $I$. The map $m$ is surjective, hence the image of $f: \operatorname{Spec}A\rightarrow \operatorname{Spec}A\times\operatorname{Spec}A$ is $V(I)$.
If we assume that $V(I)$ is also open, then is $f$ an open immersion?
As far as I know, an immersion with closed image is a closed immersion, but an immersion with open image maybe not an open immersion?
Thanks.
It's helpful to remember the sheaf-theoretic conditions on immersions: an open immersion $f:Y\to X$ must have that the induced maps $\mathcal{O}_{X,f(y)}\to\mathcal{O}_{Y,y}$ are isomorphisms for all $y\in Y$, while a closed immersion only implies that those maps are surjections. Assuming $f$ is a closed immersion and adding the condition $f(Y)$ open only implies that the kernel of $\mathcal{O}_{X,f(y)}\to\mathcal{O}_{Y,y}$ is in the nilradical of $\mathcal{O}_{X,f(y)}$, which is not enough to guarantee that we have an open immersion unless $\mathcal{O}_{X,f(y)}$ is reduced for all $y\in Y$.
Here is an explicit example in your specific case. Let $R=k$ be a field and let $A=k[\epsilon]/(\epsilon^2)$. Then $A\otimes_R A\cong k[\epsilon_1,\epsilon_2]/(\epsilon_1^2,\epsilon_2^2)$, so both $\operatorname{Spec} A$ and $\operatorname{Spec} A\otimes_R A$ are single points, and if $\operatorname{Spec} m$ is an open immersion it must be an isomorphism. Hence $m$ should be an isomorphism, but one can immediately see that this is not the case as $1\otimes\epsilon-\epsilon\otimes1$ is in the kernel.