The halting problem is to determine for an arbitrary deterministic algorithm A and an input I whether algorithm A with input I ever terminates (or enters an infinite loop). It is well known that this problem is undecidable.
The basis of the proof is to suppose that one can determine if a machine will stop on (for our purposes, accept) specific inputs and show that there will always exist a string that no machine can determine (accept). The proof is based on a technique called diagonalization.
From Introduction to Automata Theory, Languages, and Computation, Hopcroft and Ullman, Addison Wesley Publishing Company, Reading Massachusetts, 1979, page 183
We construct a language Ld by using the diagonal entries of the table to determine membership in Ld. To guarantee that no TM accepts Ld, we insist that wi is in Ld if and only if the (i, i) entry is 0, that is, if Mi does not accept wi. Suppose that some TM Mj accepted Ld. Then we are faced with the following contradiction. If wj is in Ld, then the (j,j) entry is 0, implying that wj is not in L(Mj) and contradicting Ld = L(Mj).
On the other hand, if wj is not in Ld, then the (j,j) entry is 1, implying that wj is in L(Mj), which again contradicts Ld = L(Mj). As wj is either in or not in Ld, we conclude that our assumption, Ld = L(Mj), is false. Thus, no TM in the list accepts Ld and by ( an earlier theorem) no TM whatsoever accepts Ld.
Suppose we have a list of ( 0 + 1 )* in canonical order, where wi is the ith word, and Mj is the TM whose code is the integer j written in binary. Imagine an infinite table that tells for all i and j whether wi is in L(Mj). The figure below suggests such a table. 0 means wi is not in L(Mj) and 1 means it is.
