There are sharped and flatted notes available in the key of C; they are individually marked on the sheet music, and called incidentals. Consider a passage which resolves by climbing by half-steps from A to C: A, B-flat, B-natural, C. (A biut odd-sounding, but not out of the realm of possibility.) The second note is written as a B but with a flat sign alongside it.
In other keys than C (major and A minor, to be technical), the key signature at the beginning of the staff identifies which notes are to be always sharped or flatted. In music with a E-minor signature, for example, every time you see an F written, it is to be played as a F-sharp. If the actual note F-natural is called for, it will be flagged with a ‘natural’ sign – if the # sign can be described as a Cubist depiction of an octopus, the natural sign has only two arms, pointing up and down from opposite corners. The arrangement of the Londonderry Air I’ve seen, for example, is written in what I think is C-minor, and has five flats, with only C and F “on the white keys.” Only where a sharp or flat not present in the key signature is called for is an incidental used.
As for why one has keys in the first place, there are two reasons, one intensely practical and one aesthetic. First, while keyboards and a few other instruments can play a very broad range, most singing voices and many instruments have a limited range. Transpose a song for a woman singer written in C to the key of G, and only a trained operatic soprano (or a contralto, if set down an octave) will be able to reach the extreme notes. Placing it in an appropriate key keeps it within most singers’ range.
Second, there is an aesthetic sense that various key signatures carry particular emotional baggage with them. The key of E, for example, seems to be often used for bombastic or joyful pieces, full of enthusiasm, while E-flat carries more a sense of hope amid gloom. This point can easily be overdone, but there does seem to be some validity to it, in the sense that “often music in this key will carry this emotional atmosphere.”