  In a certain class of scalar-Gauss-Bonnet gravity, the black holes and the
neutron stars can undergo spontaneous scalarization -- a strong gravity phase
transition triggered by a tachyonic instability due to the nonminimal coupling
between the scalar field and the spacetime curvature. Studies of this
phenomenon have, so far, been restricted mainly to the study of the tachyonic
instability and stationary scalarized black holes and neutron stars. To date,
no realistic physical mechanism for the formation of isolated scalarized black
holes and neutron stars has been proposed. We study, for the first time, the
spherically symmetric fully nonlinear stellar core collapse to a black hole and
a neutron star in scalar-Gauss-Bonnet theories allowing for a spontaneous
scalarization. We show that the core collapse can produce scalarized black
holes and scalarized neutron stars starting with a nonscalarized progenitor
star. The possible paths to reach the end (non)scalarized state are quite rich
leading to interesting possibilities for observational manifestations.
