This might sound easy with /etc/group and /etc/passwd, but what if you use libnss-mysql for example and need to try if it works?
So just forget grepping config files. Here are the real commands:
Members of a group:
getent group GROUPNAME
Replace GROUPNAME with the group you want to check.
Groups of a user:
groups USERNAME
Replace USERNAME with the name of the user to check.
Checked on Debian, not sure if it works on any Linux/Unix.