Display category name by category id in Magento.
<?php
$categoryId = 5; // Change category id according to you
// display name and other detail of all category
$_category = Mage::getModel('catalog/category')->load($categoryId);
// category name
echo $categoryName = $_category->getName();
// category description
echo $categoryDescription = $_category->getDescription();
// category url
echo $categoryUrl = $_category->getUrl();
// category thumbnail
echo $categoryThumbnail = $_category->getThumbnail();
// category level
echo $categoryLevel = $_category->getLevel();
// parent category
echo $parentCategoryId = $_category->getParentId();
?>