We close affirmatively a question which has been open for long time: decidability of the HOM problem. The HOM problem consists in determining, given a tree homomorphism D and a regular tree language E represented by a tree automaton, whether DGFHEPI is regular. In order to decide the HOM problem, we develop new constructions and techniques which are interesting by themselves, and provide several significant intermediate results. For example, we prove that the universality problem is decidable for languages represented by tree automata with equality constraints, and that the equivalence and inclusion problems are decidable for images of regular languages through tree homomorphisms. Our contributions are based on the following new constructions. We describe a simple transformation for converting a tree automaton with equality constraints into a tree automaton with disequality constraints recognizing the complementary language. We also define a new class of automata with arbitrary disequ...