How to testfor a custom item in player off hand 1.12 version

Solution 1:

Didn't have access to Minecraft when I posted the comment, so just to finalize this question again as answer...

The part to access the offhand slot is Slot:-106b so the command is as follows:

/testfor @p {Inventory:[{Slot:-106b,id:"minecraft:stick", tag:{display:{Name:"Rainbow Stick", Lore:"The best stick!"}}}]}

As of 1.12 it is required to encase Strings with " " if they contain non-whitelisted characters (including : and spaces). This answer explains it.