Option 1 -> "about herself" doesn't form a natural collocation with "spend hours" and doesn't convey a clear meaning in this context.
Option 2 -> "by herself" is an idiomatic expression meaning "alone" and naturally collocates with "spend hours" to indicate solitary study.
Option 3 -> "with her" is incomplete without an object and creates an ungrammatical sentence.
Option 4 -> "for herself" doesn't fit idiomatically; we don't say "spend hours for herself" when describing someone studying alone.
Hence, Option 2: by herself -> The phrase "by herself" correctly indicates that Erica spent time alone in the library, which perfectly complements the context of her being a self-taught mathematician who would naturally study independently -> correct