Solution (source code)

= Solution

For $f(x)=xe^{-2x^2}$, the <product rule> and <chain rule> give
$$
f'(x)=e^{-2x^2}(1-4x^2).
$$
The positive exponential factor makes $f$ increasing for $0<x<1/2$ and decreasing for $1/2<x<1$. Its only interior <stationary point> is therefore a maximum at $x=1/2$. Checking it together with both endpoints,
$$
f(0)=0,\qquad f(1/2)=\frac12e^{-1/2},\qquad f(1)=e^{-2}.
$$
Consequently
$$
\boxed{\min_{[0,1]}f=0\text{ at }x=0,\qquad\max_{[0,1]}f=\frac1{2\sqrt e}\text{ at }x=\frac12.}
$$
Checking the endpoints is necessary for extrema on a <closed interval>.