The correct answer is A. I and III only.
Here's a brief explanation of each statement:
I. True. The formation of the solar system started with the collapse of a fragment of an interstellar cloud of dust and gas due to gravity, which caused it to begin rotating.
II. False. The planets were not originally orbiting a nearby star; they formed from the same protoplanetary disk around the Sun, not from another star.
III. True. Gravity did play a critical role in allowing small particles in the solar nebula to stick together, leading to the formation of larger bodies that eventually became planets.
IV. False. The Sun was formed in a solar nebula and did not get pulled away from a nearby star cluster; it formed from the collapse of the nebula itself.
Together, the valid options are I and III, thus A is the correct choice.