Yum is part of CentOS4.2, it is on the installation media or here;
http://dag.wieers.com/rpm/packages/yum/
You will also need these dependencies installed;
Requires: python, rpm-python, rpm >= 0:4.1.1
Requires: python-sqlite, urlgrabber, python-elementtree
Requires: libxml2-python
Again all are on the installation media or at Dag's site, get the el4 versions.