When writing the domain of a function, in set builder notation, how does one correctly write the set of all real numbers? E.g. for $f(x) = 3x+2$, which of the following would correctly state the domain? Are they all OK, just some better than others, or are some incorrect?
$$\{x \in \mathbb{R}\}, \qquad x \in \mathbb{R}, \qquad\text{or}\qquad \{x | x\in \mathbb{R}\}$$
The domain of a function is a set, thus whatever notation you use, it should specify some set. Beyond that, there are some conventions about how one specifies a set, or how one might want to specify a particular set under a specific set of instructions, but these conventions often come down to a matter of taste rather than anything deeply mathematical. Examining the proposed notations:
The notation $\{x \in \mathbb{R} \}$ is a little ambiguous, but would probably be understood. As Eike Schulte points out, there is something missing—either the "selection criterion" which tells you how you are choosing element of $\mathbb{R}$, or you are specifying the name and domain of some variable which will be acted on by some selection criterion. That is, the notation does not tell us if $x\in\mathbb{R}$ is the selection criterion, or if it is just naming a real variable which is going to be acted on by some selection. More generally, set builder notation typically has the following form: $$ \{ \text{variable specification} \mid \text{selection criterion} \}. $$ For example, $$ \{ x\in\mathbb{R} \mid x \ge 47 \} \qquad\text{or}\qquad \{ x\in \mathbb{C} \mid x \in \mathbb{R} \}. $$ In the first example, a variable is specified (we are going to build a set of of real numbers, which we will call $x$ for the sake of selecting particular element of $\mathbb{R}$), and then acted upon by some selection criterion (we only consider values of $x$ which are greater than or equal to $47$).
That being said, authors will often shorten their notation if there is little danger of ambiguity. For example, in my own work, I often use the notation $ \{ \Re(s) > D \}, $ which is shorthand for $$ \{s\in\mathbb{C} : \Re(s) > D \}, $$ where $\Re(s)$ denotes the real part of a complex number $s$. In context, this notation is perfectly clear. On the other hand, it is potentially ambiguous in other settings.
The notation $x\in\mathbb{R}$ does not specify a set. Instead, it specifies an element of a set. This notation is read "$x$ is an element of the set $\mathbb{R}$". It is possible that this could be written into a sentence to specify the domain of a function, e.g. "The domain of $f$ is all $x$ such that $x\in\mathbb{R}$." However, this sentence is somewhat clunky.
Of the options presented, $\{ x \mid x\in\mathbb{R} \}$ is the best. It specifies a set (rather than an element of a set) in a completely unambiguous manner. On the other hand, it is kind of redundant, since $$ \{x \mid x \in \mathbb{R} \} = \mathbb{R}. $$ Instead of writing this in set builder notation, one could just write the name of the set (i.e. $\mathbb{R}$).
A Small Typographical Note: The vertical bar used in set builder notation should have a little bit of space around it. Rather than typing
|, you might consider using\mid. For use with large braces,\,\middle|\,also works: $$\left\{ \frac{x}{y} \,\middle|\, x\in \mathbb{Z}, y\in\mathbb{N} \right\}. $$ Finally, you could also use a colon: $\{ x\in\mathbb{R} : x \ge 47\}$.