Dipende da come hai usato il trim e dove lo hai messo, comunque, qui sotto trovi il codice un po' sistemato e funzionante.
Chiaramente non usarlo così com'è, perché non è esaustivo, per esempio non verifica se nel campo età ci metti un numero (come dovresti) oppure qualsiasi altra cosa, verifica solo se il campo è compilato o no.

form.php
Codice PHP:
<?php session_start(); ?>
<form name="form1" method="post" action="script.php">
    Nome: <input type="text" name="nome" value="<?php echo isset($_SESSION['nome']) ? $_SESSION['nome'] : '' ?>" />
    <div style="color: red"><?php echo isset($_SESSION['errore_nome']) ? $_SESSION['errore_nome'] : '' ?></div>

    Età: <input type="text" name="eta" value="<?php echo isset($_SESSION['eta']) ? $_SESSION['eta'] : '' ?>" />
    <div style="color: red"><?php echo isset($_SESSION['errore_eta']) ? $_SESSION['errore_eta'] : '' ?></div>
    <input type="submit" name="submit" value="Invia" />
</form>

script.php
Codice PHP:
<?php
session_start
();
// reset eventuali errori precedenti
unset($_SESSION['nome']);
unset(
$_SESSION['eta']);
unset(
$_SESSION['errore_nome']);
unset(
$_SESSION['errore_eta']);

// dirà se sono stati rilevati problemi nella validazione
$errori false;

// verifica se è stato inserito un nome oppure no (campo nome obbligatorio)
if ( ! isset($_POST['nome']) || trim($_POST['nome']) == '' )
{
    
$_SESSION['eta'] = $_POST['eta'];
    
$_SESSION['errore_nome'] = 'Il campo nome è obbligatorio';
    
    
// trovato un problema
    
$errori true;
}
// verifica se è stato inserita l'età oppure no (campo età obbligatorio)
if ( ! isset($_POST['eta']) || trim($_POST['eta']) == '' )
{
    
$_SESSION['nome'] = $_POST['nome'];
    
$_SESSION['errore_eta'] = 'Il campo età è obbligatorio';

    
// trovato un problema
    
$errori true;
}

if ( ! 
$errori )
{
    echo 
"tutto ok";
}
else
{
    
header('Location: http://localhost/form.php');
}
?>