Place this code in single.php where you need to show it:
<?php
$catarray = get_the_category( $post->ID );
foreach ($catarray as $cat) {
$catid = $cat->term_id;
if ($catid == 5) {
echo 'TEXT HERE';
}
if ($catid == 7) {
echo 'ANOTHER TEXT';
}
}
?>