OG groups: How to check if user is a member or not?
For the 7.x-2.x branch of Organic Groups you need to use the following code.

og_is_member('node', $gid, 'user', $user)


'node' is the entity type. The function og_is_member requires 4 parameters to return the correct value.