Do you know how to install the software? I have the disks.
Big question. There are a lot of "depends" at work.
Do the disks have a black or dark purple background, or a gray background?
The dark-background disks are full retail install disks and can install the OS on any supported Mac. Gray disks are the install/restore disks that ship with a particular computer. They must match the model of the computer to work. Grey disks from another model Mac seldom work and, it they are from an Intel-based iMac, they won't work at all on the older PowerPC Macs like your iMac G4.
Read the disk labels carefully for the version of the Mac OS they install. It will be "Mac OS" and then "10.something" where "something" is a very important number. Tell us that number
That model iMac cannot run any higher Mac OS than OS 10.5 "Leopard."
Once we establish the type of disks, we can proceed to installation if it looks like you have the right disks.
.