a) we bring the rod closer to one of the spheres connected to Earth,
we disconnect the ground cable and move the rod away and join the two spheres with the wire
b) we connect a sphere to ground, bring the rod closer
we disconnect the ground cable
Now we bring the rod closer to the other isolated sphere
Explanation:
In this interesting exercise we will use that electric charges are of two types positive and negative, where charges of the same sign repel and of opposite sign attract.
In metals the charges are mobile and can be displaced, we will conspire the earth as a receptor of charges and the glass rod does not have mobile charges, but it does have charges created by friction with silk.
With these concepts let's analyze the requested situations
a) How to create charge of equal magnitude and same sign in the spheres.
To create this situation we bring the rod closer to one of the spheres connected to Earth with the wire, in this case the charge induced by the sphere stops to the ground, then we disconnect the ground cable and move the rod away, therefore the sphere that with a charge of equal magnitude of the rod but of opposite sign.
Now we join the two spheres with the wire and the charge is distributed between the two, we remove the wire and each sphere with a charge equal to the mistad of the cheek and of the opposite sign.
Therefore the two spheres have a charge of equal magnitude and sign.
b) how to create charge of equal magnitude and opposite signs.
For this case we connect a sphere to ground with the wire, we bring the rod closer and an induced charge is created on the sphere of equal magnitude to the rod charge and of opposite sign, an equal charge and of the same sign as the rod passes to ground through the wire, disconnect the wire and remove the rod. The sphere with a charge equal to that of the rod and with the opposite sign.
Now we bring the rod closer to the other isolated sphere, an induced charge of opposite sign to the rod and of the same magnitude is created,
in this case we keep the rod in this position and we have two charges of equal magnitude, but without opposite in each sphere