In the first scenario, 3 cannot be G or I because then either 2 or 4 would G or I and this would violate them not being beside the other. This means 3 is H. If H is R, then G must be R and its only possibility to be R would be in slot 2. And slot 4 would be I.
Q R R S F G H I
In the second scenario, 3 and 4 cannot both be G and H because then they would be different in terms of R/S/Q. One of G/H must be one and the other must either be 3 or 4. The other 3/4 must be I. This leaves us with..
R/S Q R S G/H F I G/H
With I in 3 and G/H in 4 being interchangeable. However, we need to realize that we cannot have G in 3 or 4 because it would be beside I. Meaning that the latter G/H is H and the earlier is G
R/S Q R S G F I H
With the I and H being interchangeable. This is why G can never be 3 or 4.
I hope this helps and you were able to follow it in written format like this. Please let me know if you'd like me to clarify anything!