I was wondering why it is not possible. Is it because the corresponding language is not decidable, or because of the fact that it is not guaranteed that a Turing machine halts on every input?
Your exam question makes very little sense. The obvious reading would be this:
Let $M$ and $N$ be two Turing machines. Why is it not possible to prove that $M$ and $N$ compute the same function?
It is not the case that for all Turing machines $M$ and $N$ it is provable that $M$ and $N$ compute the same function.
Well, this is quite obvious: there exist two Turing machines that calculate different functions, say a Turing machine $M$ that computes the function $n \mapsto n + 1$, and a Turing machine $N$ that computes the function $n \mapsto 42 \cdot n$. Therefore, in general, $M$ and $N$ need not compute the same function, so in general we cannot prove that they do.
I am going to guess that whoever asked this question really wanted to ask:
Show that there is no decision procedure which decides, given any Turing machines $M$ and $N$, whether they compute the same function.
This is a standard exercise in computability theory, but is completely different from the question. One should not mix up things like "prove" and "decide".
I suggest that you go back to the author of the question and ask them to participate in this discussion. Then perhaps we can clear up the confusion, and save some students from unnecessary suffering.
Supplemental: A hint on how to show that such comparison is not decidable: given a Turing machine $T$, produce a new Turing machine $M$ which on input $n$ outputs $1$ if $T$ halts in fewer than $n$ steps, and $0$ otherwise. Compare $M$ to the machine which always output $0$.