Doubt regarding grounding of a sphere and charge distribution An insulated sphere with dielectric constant $K$ (where  $K>1$) of radius of $R$ is having a total charge $+Q$ uniformly distributed in the volume. It is kept inside a metallic sphere of inner radius $2R$ and outer radius $3R$. Whole system is kept inside a metallic shell of radius $4R$, metallic sphere is earthed as shown in the figure.  Spherical shell of radius $4R$ is given a charge $+Q$. Consider $E-r$ graph for $r > 0$ only.

Well I started working out on this by considering $-Q$ charge induced on the inner side of the metallic sphere (since by application of Gauss theorem the electric field inside a conductor should be null) and proceeded by considering unknown charge $q$ on the outer side of the sphere where it is grounded (or so I understood).
by taking potential zero I calculated $q= -3Q/4$ but I believe I must have gone wrong somewhere

will these values of charges still hold that the electric field inside the conductor (metallic sphere) is zero
 A: (Edit: originally I neglected the shell at $r = 4R$ completely, thank you to Urb for pointing this out. Since fields superimpose, we can add the effect of this shell to what has already been calculated.)
First, let's neglect the outer charged shell at $r = 4R$.
If the inner metallic shell (the one that has inner radius $2R$ and outer radius $3R$) were not connected to ground, then the total charge on the outer surface (at $r = 3R$) would be $+Q$ since the conductor is net neutral and $-Q$ amount of charge has been displaced to the inner surface, so the outer surface is left with electron holes that give it an overall charge of $+Q$. The reason why $-Q$ charge must be displaced to the inner surface is so that there is no electric field within the conductor, so any Gaussian surface within the conductor must enclose net zero charge. Since the insulator carries $+Q$ charge, the inner surface of the conductor must carry $-Q$ charge.
Since the inner metallic shell is grounded, however, think of it like this: the Earth effectively provides an infinite supply of electrons that can fill up the holes left by the electrons in the conductor that got moved to the inner surface. Thus, the charge on the inner surface (at $r=2R$) is still $-Q$, but the charge on the outer surface (at $r=3R$) is now $q = 0$ since the electron holes have been filled.
Now, what happens if we add the charged shell at $r = 4R$? The positive charge will draw negative charge from the Earth and it will collect on the outer surface. The amount of charge drawn will now depend on the radii of the spheres, in contrast to the situation at the inner surface, which will always carry charge $-Q$ no matter the radii of the insulator or the conductor. One way to see why this is, is that if the inner radius of the grounded sphere got bigger, the negative charge pulled to the inner surface would get smaller because it is now further away from the positive charge on the insulator, but the total surface area that collects this charge gets bigger, so overall the total charge that collects at the surface will be the same (field drops as $1/r^2$, but the surface area grows as $r^2$, so the radius dependence cancels). By contrast, at the outer surface of the grounded sphere, if its radius got smaller, now not only does the negative charge drawn by the positively charged outer sphere get smaller because they are now separated by a greater distance, the surface area it collects on gets smaller too, so the total charge that collects on the outer surface will depend on the radii of the spheres.
So, how much charge collects at the outer surface of the grounded sphere? The insulator and the charge at the inner surface we can completely neglect from now on, because effectively the grounded insulator isolates us from whatever charge there was there. First let's consider only the outer charged shell. The potential at $r = 4R$, which I'll call $\phi_0$ is:
$$
\phi_0 = \phi(r=4R) = \frac{Q}{4\pi \epsilon_0 \cdot 4R}.
$$
For $r < 4R$, considering only the charged outer shell, the potential will satisfy Laplace's equation $\nabla^2 \phi = 0$ since there is no enclosed charge. By the uniqueness theorem, the potential due only to the outer charged shell will therefore be $\phi_0$ throughout the interior $r<4R$. So this is the contribution to the potential from the outer charged shell. Now putting back the grounded conductor, in the grounded conductor, we must have $\phi = 0$. The field contribution at $r=3R$ from the outer shell is $\phi_0$ as we now from above. So, the potential from the negative charge that collects at this outer surface, which I'll call $q$, must contribute exactly $-\phi_0$ in order to cancel and be zero. Thus, at $r=3R$, we must have:
$$
\phi(r=3R) = \frac{q}{4\pi\epsilon_0 \cdot 3R} + \phi_0 = 0.
$$
So, $q = -3Q/4$. This is the charge that must collect at the outer surface of the grounded conductor so that the potential due to the insulator and the charge at the inner surface (these two by themselves cancel), and the charge itself at the outer surface and the charged outer sphere all cancel.
Will the potential in the interior of the grounded sphere still be zero? Yes. The potential here will be the potential of the outer charged sphere plus the potential due to the charged outer surface of the grounded conductor. Remember that for $r>2R$, the effects of the charged insulator are shielded by the conductor by the collection of the $-Q$ charge boundary on the inner surface: for $r>2R$ these two will always cancel each other, so we need only consider the outer charged surface and the outer charged sphere for $r>2R$. The potential from the outer charged sphere is $\phi_0$ no matter where within the sphere we are ($r<4R$); we calculated this above. What about the charged outer surface? Calculate this as we did for the outer charged sphere: at $r=3R$ we know that the total potential is zero, so the potential due only to the charged outer layer here must be $-\phi_0$. For any position $r<3R$, since the charge enclosed by a Gaussian surface is zero, and by the uniqueness theorem, the potential due only to the charged outer surface must also be $-\phi_0$, no matter where we are. So, we have $\phi = \phi_0$ throughout $r<4R$ from the outer shell, and we have $\phi = -\phi_0$ throughout $r<3R$ from the outer charged surface. So, for $2R<r<3R$, which includes the grounded conductor, we must have $\phi = -\phi_0 + \phi_0 = 0$. (When we go $r<2R$ we must also add the potential from the inner charged surface and the charged insulator too.)
I hope this clarifies the issue, but I appreciate that it is hard to follow. The key points are this:

*

*The electric field in a conductor is always zero, and the potential is constant but does not have to be zero.

*The potential of a grounded conductor always additionally sets the potential to be zero (or more accurately, whatever the potential of the grounding element is, which we usually take to be zero).

*A grounded conductor will always shield the enclosed region from the outside region, and vice versa; so any calculation in the one region can neglect the charge content (and potential fields) of the other.

*The potential inside a shell of charge $q$ and radius $a$ is $\phi = q/4\pi\epsilon_0 a$, throughout the interior of the shell $r<a$.

*The total potential (or electric field) can be added from the potentials (or electric fields) of each charge or set of charges in isolation.

These five points will, I believe, answer all of your questions/doubts.
(In a previous edit I mentioned Paul Falstad's applets at https://www.falstad.com/emstatic/; I'll leave the reference here because they can be useful.)
