Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
The fibre $X_P$ over a nonzero point $P\in S$ is the union of a point and a double point (because $27t^2 + 4s^3$ is the discriminant). To find a nilpotent, you want an $f \in \Gamma(S,\mathcal{O}_X)$ s.t. its restriction to each $X_P$ is 0 on the simple point and in the maximal ideal of the double point. Fix $P =(s,t)$, and let $x^3+sx+t = (x-r_1)(x-r_2)^2$. Expanding, you find $r_1 = -2r_2$, hence $t = 2r_2^3$ and $s=-3r_2^2$. Notice that on the fibre $X_P$, $f_P = (x-r_1)(x-r_2)$ is a nilpotent. Mult. this by $r_2^2$ to get $r_2^2x^2+r_2^3x-2r_2^4$ which is then nilpotent and regular.
EDIT: The following is an example showing that the genericity assumption mentioned in that answer is in fact necessary. The rank of $M$ doesn't have to be $r-1$ at any point, take for instance the case where $X = \mathrm{Spec}\ k[x,y]$ and $E$ is a trivial rank 2 bundle. Let $M$ be given by $$ M=\pmatrix{x & 0 \\ 0 & x}, $$ which gives $M$ rank 0 on the curve $C = \{(x,y) | x = 0\}$. In this case the cokernel of the map $\mathcal{O}^2_X \to E$ is a rank 2 bundle on $C$.