2 added 190 characters in body

Theorem 1: Let $R$ be an integral domain with field of fractions $K$, and $R \to A$ a homomorphism. Then $Spec(A) \to Spec(R)$ is an open immersion if and only if $A=0$ or $R \to K$ factors through $R \to A$ (i.e. $A$ is birational over $R$) and $A$ is flat and of finite type over $R$.

Proof: Assume $Spec(A) \to Spec(R)$ is an open immersion and $A \neq 0$. It is known that open immersions are flat and of finite type. Thus the same is true vor $R \to A$. Now $R \to K$ is injective, thus also $A \to A \otimes_R K$. In particular, $A \otimes_R K \neq 0$. Open immersions are stable under base change, so that $Spec(A \otimes_R K) \to Spec(K)$ is an open immersion. But since $Spec(K)$ has only one element and $Spec(A \otimes_R K)$ is non-empty, it has to be an isomorphism, i.e. $K \to A \otimes_R K$ is an isomorphism. Now $R \to A \to A \otimes_R K \cong K$ is the desired factorization.

Of course, the converse is not as trivial. It is proven in the paper

Susumu Oda, On finitely generated birational flat extensions of integral domains Annales mathématiques Blaise Pascal, 11 no. 1 (2004), p. 35-40

It is available online. In the section "Added in Proof." you can find some theorems concerning the general case without integral domains. In particular, it is remarked that in E.G.A. it is shown that

Theorem 2: $Spec(A) \to Spec(R)$ is an open immersion if and only if $R \to A$ is flat, of finite presentation and an epimorphism in the category of rings.

More generally, in EGA IV, 17.9.1 it is proven that a morphism of schemes is an open immersion if and only if it is flat, a (categorical) monomorphism and locally of finite presentation.

There are several descriptions of epimorphisms of rings (they don't have to be surjective), see this MO-question.

1

Theorem 1: Let $R$ be an integral domain with field of fractions $K$, and $R \to A$ a homomorphism. Then $Spec(A) \to Spec(R)$ is an open immersion if and only if $A=0$ or $R \to K$ factors through $R \to A$ (i.e. $A$ is birational over $R$) and $A$ is flat and of finite type over $R$.

Proof: Assume $Spec(A) \to Spec(R)$ is an open immersion and $A \neq 0$. It is known that open immersions are flat and of finite type. Thus the same is true vor $R \to A$. Now $R \to K$ is injective, thus also $A \to A \otimes_R K$. In particular, $A \otimes_R K \neq 0$. Open immersions are stable under base change, so that $Spec(A \otimes_R K) \to Spec(K)$ is an open immersion. But since $Spec(K)$ has only one element and $Spec(A \otimes_R K)$ is non-empty, it has to be an isomorphism, i.e. $K \to A \otimes_R K$ is an isomorphism. Now $R \to A \to A \otimes_R K \cong K$ is the desired factorization.

Of course, the converse is not as trivial. It is proven in the paper

Susumu Oda, On finitely generated birational flat extensions of integral domains Annales mathématiques Blaise Pascal, 11 no. 1 (2004), p. 35-40

It is available online. In the section "Added in Proof." you can find some theorems concerning the general case without integral domains. In particular, it is remarked that in E.G.A. it is shown that

Theorem 2: $Spec(A) \to Spec(R)$ is an open immersion if and only if $R \to A$ is flat, of finite presentation and an epimorphism in the category of rings.

There are several descriptions of epimorphisms of rings (they don't have to be surjective), see this MO-question.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9803367853164673, "perplexity": 79.99651831290618}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-20/segments/1368706934574/warc/CC-MAIN-20130516122214-00027-ip-10-60-113-184.ec2.internal.warc.gz"}