I recently came across the need to show two prices on the product and catalog pages of Magento depending on whether or not the customer was logged in under the "wholesale" or "retail" customer group. Ultimately, if you ever need to do something with one customer group that you would or wouldn't with another, this is your code.
<?php
// Step 1. Check if customer is logged in
$loginStatus = Mage::getSingleton('customer/session')->isLoggedIn();
if($loginStatus)
{
// Step 2. Now get Customer's Group ID and do something with it
$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
echo "Group ID: " . $groupId;
$group = Mage::getModel('customer/group')->load($groupId);
echo "Group Name: " . $group->getCode();
}
?>