  We study the self-compactification of extra dimensions via higher curvature
gravity, f(R), where f(R) is the generic function of the Ricci scalar R. First,
we reduce pure f(R) theory to a scalar-tensor theory by a conformal
transformation. Then we show that, by a second conformal transformation, this
scalar-tensor theory turns out to a nonminimal scalar-tensor theory. We find
non-vanishing scalar field configurations that satisfy the conditions on the
partially vanishing energy-momentum tensor and the equations of motion of the
nonminimal scalar-tensor theory. It is interesting that we find that the source
of gravity has discrete spectrum. The minimum of the potential changes
according to the value of the coupling constant of the scalar field to the
curvature scalar. When the minimum is at zero for a vanishing scalar field, the
entire spacetime is flat. When the minimum is at a nonzero value for a
non-vanishing scalar field, the extra space is compactified. We thus show that
a given f(R) theory can self-compactify the extra dimensions.
