Suppose you have that dg/dR = -2g/R. The entire expression dg/dR is an atomic symbol representing the derivative of g with respect to R. While it is presented as a fraction, it is not technically a fraction in the normal sense. When you have d(something) by itself, this is known as an "infinitesimal". Infinitesimals aren't like "normal" numbers, but generally speaking when you divide one by another, their weirdness "cancels out", and we can treat the ratio as being a normal number. So even though infinitesimals aren't normal numbers, for a lot of purposes, we can pretend they're normal numbers, and multiply both side by the one of them. In this case, if we multiply both sides by dR, that gives us dg = -2 dR/R.
In the example you give, rather than starting with dg/dR = -2g/R, the example starts with log(g) = log(G)+log(M)-2log(R), and takes the derivative of both sides. Normally, when you take the derivative, you take the derivative of one thing with respect to a second thing, and you say that d(first thing)/d(second thing) = derivative. However, there's a concept of an "implicit" derivative where you take the derivative of each term, but instead of taking the derivative with respect to something, you just leave the infinitesimal for the variable in that term. So when you have log(g), the derivative of that is 1/g, and then you include the infinitesimal for g, getting dg/g. Similarly, we get dR/R on the other side (G and M can be ignored because the are constants, and thus their derivatives are zero).
If we want the explicit derivative, we'll have to divide both sides by dR. However, when you have dR/R, notice that you're dividing the change in R by the total R. That can be thought of as a percent (a percent is part of something divided by the total). Since we're given a percent, and we're asked for another percent, it's easier to just keep it in the form dR/R.
This example is a bit imprecise, however; it treats the instantaneous rate of change (derivative) as being the same as the overall rate of change. For small percentages, this is a decent approximation, but it wouldn't work for larger ones. Treating dR/R, or dy/y, as being "equal" to something is playing a bit loose with calculus. Strictly speaking, you have to have a ratio between two such expressions. For instance, if dy/y = 2dx/x, then that means that if x increases by a certain percentage, then y will increase by about twice that percentage (and it will get closer to exactly twice the closer the percentage is to zero). If y increases by 4%, then x must have increased by about 2%.
Also, in the example, there's a bit of a space between d and R, which is probably a typesetting issue. It should be -2dR/R, not -2d R/R.