Let $X$ be a scheme of finite type (say over the complex numbers). The set of points for which the local ring is reduced is then an open subset $U\subseteq X$.
Is it true that there is a closed subscheme $Z\hookrightarrow X$ such that
- $Z$ is supported on $X\smallsetminus U$ and
- $X$ is the coproduct $X\simeq X_{\mathrm{red}}\cup_{Z_{\mathrm{red}}}Z$ in the category of schemes?
An affine example:
$$X=\mathrm{Spec}\frac{k[x,y]}{(xy,y^2)}, \quad Z=\mathrm{Spec}\frac{k[y]}{(y^2)},\quad X_{\mathrm{red}}=\mathrm{Spec}(k[x])=\mathbb{A}^1_k, \quad Z_{\mathrm{red}}=\mathrm{Spec}(k),$$
$Z\to X$ given by $y\mapsto y$, $Z_{\mathrm{red}}\to Z$ given by $y\mapsto 0$, $Z_{\mathrm{red}}\to X$ given by $x\mapsto 0, y\mapsto 0$.
so $X$ is a line with an embedded point sticking out from the origin, $U=\mathbb{A}^1\smallsetminus\{0\}$, and $Z$ is the infinitesimal first-order "segment". Now, if I'm not mistaken,
$$\frac{k[x,y]}{(xy,y^2)}\simeq k[x]\times_k \frac{k[y]}{(y^2)}:=\{ (a(x),b(y))\in k[x]\times \frac{k[y]}{(y^2)} \mid a(0)=b(0)\}$$
by $x\leftrightarrow(x,0), y\leftrightarrow (0,y)$, so the algebra of $X$ is the fibered product of those of $X_{\mathrm{red}}$ and $Z$ over the evaluations to $k$, hence $X$ is the corresponding coproduct of schemes.