This graph is just deterministic finite automaton[1] with some fancy rules to make it easier to remember and to draw less arrows. What this proves is that that when you look at natural numbers as a words over {0, 1, ..., 9} alphabet, numbers divisible by 7 form a regular language[2]. This method generalizes to divisiblity by any number, not just 7, though it requires some cunning to come up with a nice way of representing the DFA like in OP's post, without tens or hundreds of arrows.
Another cool thing in this is that existence of such graph implies existence of a regular expression testing divisibility by 7. Indeed, it's easy to check divisibility by 2 or 5 using regular expressions, it's /^.[star](0|2|4|6|8)$/ and /^.[star](0|5)$/, where [star] means star operator (HN markup changes it to italics). It's a bit less clear how to construct similar regular expression for 7, but if follow closely the proof of equivalence between regular languages and languages recognizable by finite state automata, you can reconstruct the regular expression checking the divisibility by 7 from OP's graph.
Another cool thing in this is that existence of such graph implies existence of a regular expression testing divisibility by 7. Indeed, it's easy to check divisibility by 2 or 5 using regular expressions, it's /^.[star](0|2|4|6|8)$/ and /^.[star](0|5)$/, where [star] means star operator (HN markup changes it to italics). It's a bit less clear how to construct similar regular expression for 7, but if follow closely the proof of equivalence between regular languages and languages recognizable by finite state automata, you can reconstruct the regular expression checking the divisibility by 7 from OP's graph.
[1] - http://en.wikipedia.org/wiki/Deterministic_finite_automaton [2] - http://en.wikipedia.org/wiki/Regular_language