If I jailbreak my iphone and restore it?

If I jailbreak my iPhone, and then restore it so it will clean out the jailbreak, when I hand it over to Apple for a fix or if something goes wrong(after I restore it), will they find a trace or know it's been jailbroken before? I'm thinking about jailbreaking it, but not sure.

Nope.
once jailbroke there are files that can't be removed just by restoring.
apple can tell in 5 sec that it was jailbroke and your warranty will be void.