First, list all the three reactions that are a part of the three-step mechanism.
A + B -> M + EA+B→M+E
E + F -> G + RE+F→G+R
J + G -> B + KJ+G→B+K
To write the overall reaction, simply add these three chemical equations together. The net reaction will always be the sum of the elementary steps given to you.
A + cancel(B) + cancel(E) + F + J + cancel(G) -> M + cancel(E) + cancel(G) + R + cancel(B) + K
This is equivalent to
A + F + J -> M + R + K
Now take a look at the four species given to you, B, M, G, and F.
Notice that B starts off on the reactants' side and ends up unchanged on the products' side. This is characteristic of a catalyst, which is a chemical species that simply speeds up the reaction without being consumed in the overall process. So I'd say that
B -> color(blue)("catalyst")
On to M, which is produced by the first step of the reaction and is left unchanged throughout the ensuing two steps. This means that M is actually a product of the overall reaction, so I'd say
M -> color(orange)("product")
Now take a look at G. This compound is produced by the second step of the reaction and is immediately consumed in the third step.
This tells you that G is a very reactive compound in the context of this reaction, which, in addition to the fact that it's produced and consumed by the reaction, makes G match the characteristics of an intermediate species. I'd say that
G -> color(green)("intermediate")
FInally, compound F. Notice that this compound is being added to the reaction in the second step, in which it reacts with E, another intermediate, to form G and R, which is a product of the overall reaction.
This means that F is actually a reactant, so
F -> color(red)("reactant")