Stimuli-responsive, self-assembling nanomaterials hold a great promise to revolutionize medicine and technology. However, current discovery is slow and often serendipitous. Here we report a multiscale modeling study to elucidate the pH-controlled self-assembly of nanofibers from the peptide amphiphiles, palmitoyl-I-A3E4-NH2. The coarse-grained simulations revealed the formation of random-coil based spherical micelles at strong electrostatic repulsion. However, at weak or no electrostatic repulsion, the micelles merge into a nanofiber driven by the β-sheet formation between the peptide segments. The all-atom constant pH molecular dynamics revealed a cooperative transition between random coil and β-sheet in the pH range 6-7, matching the CD data. Interestingly, although the bulk pKa is more than one unit below the transition pH, consistent with the titration data, the highest pKa's coincide with the transition pH, suggesting that the latter may be tuned by modulating the pKa's of a few solvent-buried Glu side chains. Together, these data offer, to our best knowledge, the first multiresolution and quantitative view of the pH-dependent self-assembly of nanofibers. The novel protocols and insights gained are expected to advance the computer-aided design and discovery of pH-responsive nanomaterials.