Search the forum, this has been asked a few times already...
The iMac is an All-in-one computer, which means that all parts work together (like a laptop), but not separately ... so if you want to use one of its parts separately, DON'T BUY AN ALL-IN-ONE COMPUTER!!!
I mean, nobody tries to hook up a PC to a laptop's screen, then why do people want to try that on an iMac G3, G4 or G5?!?
Even on a PC with Video in, you cannot use the monitor hooked up to it with a second PC by connecting it to the Video in...