Here is my approach to solve it but I get stuck at some point.
1) X is compact => f(X)=Y is compact (take an open cover of Y, its preimage covers X, but X is compact => exists a finite subcover and its image covers Y, thus Y is compact);
2) let C - a closed subset of X => C is compact (take an open cover of C, then it covers X in the union with the complement of C, which is open. X - compact, exists a finite subcover => there is a finite subcover covering C);
3) the same argument works for Y: all its closed subsets are compact.
And then, I get lost...There is one similar result, where Y is Hausdorff, but here we don't have this condition and know only that Y is compact. Is there something missing in the conditions? How should I proceed?