Posted this question on cstheory.SE where they said to go here:I read the demonstration of the Halting problem, it is done by  reductio ad absurdum where the push to get to the absurd is to use the  halting function H(A,b) (where A=another function, b=the A  parameter) as its own parameter. This proofs that can't exist a  function which takes every function including its own as parameter and  says if it is an infinite loop or not, but doesn't proof that a  function Z(A,b) where {A,b!=Z} (1*) can't exist.While I deleted that question I had this answer by dkuper:It is easy to circumvent this problem, by giving to the functions the  code of a different machine which computes the same function.Say you succeeded in building your machine computing Z(a,b) which  works as you said. Then you still get the reductio ad absurdum, by  feeding to this machine the code of another machine which is  equivalent. This is always possible because for every machine M, there  are infinitely machines M which behaves the same as M (i.e. halt on  exactly the same instances). So checking that the input is not  precisely the machine M is not enough to avoid the paradox. And  checking that the input does not behave the same as M is impossible.So, now, this doesn't work if we assume that the function passed as parameter has a flag (applied by the constructor) that indicates if it is the halt function.
Trying to break the proof of undecidability of the halting problem
computability;halting problem