Let $X$ be a reduced Noetherian scheme. It has finitely many irreducible components $\{X_j \}_{j=1}^n$. Let $x_j$ be the generic point of $X_j$. If $U$ is an affine open subset of $X$ containing every $x_j$, then is it true that $\dim U=\dim X$?
Somehow, I am not sure of this even when $X$ is affine.
Please help.
No, this is not true in general. Let $X=\operatorname{Spec} k[t]_{(t)}$. Then $D(t) = \operatorname{Spec} k(t)$ is an affine open subset containing the generic point (in fact, it's just the generic point) but of dimension zero, whereas $X$ is of dimension one.
This is true if $X$ is a scheme (locally) of finite type over a field, though. In this case, the dimension of an irreducible component is the transcendence degree over $k$ of the residue field at the generic point of that component, and this is clearly preserved when passing from $X$ to $U$.