if id -nG "$USER" | grep -qw "$GROUP"; then
echo $USER belongs to $GROUP
else
echo $USER does not belong to $GROUP
fi
Explanation:
id -nG $USER
shows the group names a user belongs to.grep -qw $GROUP
checks silently if $GROUP as a whole word is present in the input.