ab = ba iff G is commutative, so for an Abelian group we can substitute for the middle bit
aabb = a(ab)b = a(ba)b = abab
Which won't hold if G is not commutative.
QED
I recognize that FizzBuzz is supposed to be easy, but it's supposed to recognize programmers with basic competence; I am not a mathematician. (But maybe I underestimate myself or overestimate some of those with advanced degrees in mathematics?)
In fairness, if you handed this in for homework in a sophomore algebra course, you likely wouldn't get credit (you've definitely proven the "only if"; the "if" is a bit murky). However, it's not too much of a stretch to clean it up into a proper proof.
edit: I did fail to re-state it, but figured it was obvious in the not-really-formal-proof setting. If that's all you meant by "a bit murky" then nevermind.
Ah, when I read your response I flipped the order of the problem around in recalling it, so had the if and only-if backwards. Yes, I was handwavy there but it seemed clear enough for the setting (which you seem to be granting anyway) - just wanted to be sure I wasn't misunderstanding something. Thanks :)
I don't really see this as being any less trivial than proving inverses are unique. Both require writing down the statements, and a couple applications of the group axioms.
I like my phrasing a little bit more because it at least requires knowledge of the definition of a group hom. Fizzbuzz also requires little more than an understanding of for loops and if statements, so I'd say they're kind of similar.
On the other hand, I know a couple extremely good analysts who would stare blankly at you until you reminded them of the definition of a homomorphism =)
To be clear, however: I think these are pretty good analogues of FizzBuzz.
Edit: If this is too easy, prove that g in G, g -> g^2 is a homomorphism iff G is abelian.
Note: I am not a mathematician.