program primo;
uses crt;
type tipo=file of integer;
var scelta:integer;
num:tipo;

procedure inserisci(n:tipo);
var nome,x:string;
i:integer;
begin
write('Nome del file:');
readln(nome);
x:='F:\File\Esercizi\'+nome;
assign(n,x);
rewrite(n);
write('Inserisci 20 numeri:');
for i:=1 to 20 do
write(n,i);
close(n);
end;

procedure scrivi(n:tipo);
var nome,x:string;
i:integer;
begin
write('Nome del file:');
readln(nome);
x:='F:\File\Esercizi\'+nome;
assign(n,x);
reset(n);
while not eof(n) do
begin
read(n,i);
write(i:3);
end;
close(n)
end;

procedure media(n:tipo);


begin
randomize;
repeat
writeln('1)Inserimento');
writeln('2)Lettura');
writeln('3)Media');
writeln('4)Pari');
writeln('5)End');
readln(scelta);
case scelta of
1:inserisci(num);
2:scrivi(num);
5:write('Addio!');
else
write('Scelta non valida!');
end;
until scelta=5;
end.


why it keeps telling me that NUM isn't initialized???

num is not set to any value in your program. it is type of file of integer so you are supposed to open one file in your main code and close it at end of it like you do in one of the procedures.