OSX is a tricky thing. 10.5 should work on a G4, but depending on your system you may need to trick the system into taking it.
Firstly, you need to have at least 1GB of ram in the system, preferably 2GB... and back in the G4 days 512MB was popular still, so you may need to upgrade that.
2nd is that Apple is fond of ditching support for computers after 3-4 generations... and PPC G4 is very far out of favor. I am admitedly BSing a bit here as I have not ever done this myself, but my understanding is that the OS installer will scan the firmware/EFI/UEFI for information which is required before allowing the installation. Sometimes this EFI information needs to be edited in order to allow older low-end macs to run the newer OSs. I am not sure if this would be the case for your mac, and I am certainly unsure how to go about it. I have only heard about it being a problem by my mac friends, especially on older G3 and G4 systems.
Sorry this may not be a lot of help, but maybe it will be able to point you in the right direction.