According to the presentation, our f, a computable function, is defined by a TM that upon reading input w, halts with only f(w) on tape.

Does this TM have to halt on all f(w)? Is it necessarily a decider?
The TM must accept each of the w inputs? Can some of them be rejected? Can the machine loop on some others?

Or does the definition mean that upon entering the accepting state, while reading w, the only output on the tape is f(w), but there is no guarentee of entring this state in general.

Also, considering the partially computable functions, is f(w) undefined only when it finishes with an empty set? What about when w is simnply rejected? Is that possible?
What is the definition of "undefined" in our scope?

If we want M to compute a *total* function, then yes, it should always halt (as in HW5).
Note that a TM that computes a function do not accept/reject, it either halts with the output on its tape or runs forever on
inputs that are not in the domain of the function (in case it is not total).

So, if M does not halt on x then f(x) is not defined (is not in the domain of the function) and otherwise
f(x) is the content of the tape.