Suppose a didn't generate G. Then there'd be some g in G that was never a power of a. But (g, 1) in GxH,
and since... (I'll leave the rest to you).
(a, b) generates GxH is given. You don't assume premises - you generally "assume" things you want to prove false by deriving a contradiction from them. The way I was going was beginning a proof by contradiction, although it could (should) have been done directly.
Rather than work it out, the REASON it's true is:
(a,b) is a generator, so (a^n,b^n) hits every element of GxH, and so it hits (g,1) for every g in G. Thus for every g in G, there's some m that makes (a^m, b^m) = (g, 1), and, in particular, makes a^m = g.