Solution (source code)

= Solution

The assertion is false. For $n\geq2$, take the affine hypersurface
$$
X_n=\operatorname{Spec}k[x,y,z]/(xy-z^n)\subset\mathbb A_k^3.
$$
It is an <integral scheme>, and its only possible singular point is the origin, which has codimension two. Hence it is <regular in codimension one>; as a hypersurface it satisfies Serre's condition $(S_2)$, so the <Serre criterion for normality> also makes it a <normal scheme>. The <Divisor class group of an A-type surface singularity> is
$$
\operatorname{Cl}(X_n)\cong\mathbb Z/n\mathbb Z,
$$
generated by $V(x,z)$. Thus a closed affine subscheme satisfying $(\star)$ can have nonzero torsion in its class group.