The Fix: Restart, Replace (Batteries), and Check
With wireless devices that are controlled via a USB hub, you want to remember one simple acronym: RRC, which stands for Restart, Replace, Check. Let's go into detail, shall we?
Restart: What this means is that you should turn off the keyboard, turn off the computer, go get something to eat, and then come back and turn everything back on. Many people don't understand this, and ask me "Why should my wireless device randomly start working again for no apparent reason?" to which I answer "Because that's the way it stopped -- randomly and for no apparent reason."
Replace: "Replace" in this process can mean a lot of things, but in this case you'll want to immediately head for the batteries. A lot of wireless keyboards don't beep or alert you in any way when batteries begin to get low, so one day things stop working and a lot of people don't even think to replace the batteries. Oh, and make sure the batteries you put in are actually new, fresh from the package. Too often have I seen people putting in old batteries thinking they were new, and then wasting money buying a new keyboard when they thought theirs was broken.
Check: The last thing you can do when your Logitech USB wireless keyboard no longer functions is the "Check" part, where you make sure that the frequency between the keyboard itself and the receiver didn't get changed somehow. Now, on most USB-driven wireless keyboards there is a switch or a dial on both devices that should read a number, and all you have to do is switch that number so that it's the same on both devices. Some other devices function with a little button that you need to push on both the receiver on the keyboard to connect them, so if you don't see a switch look for a small button as well.