Hello, try kguy's solution here...
First, Go to System Preferences, keyboard, and click on the Keyboard tab
Make sure that the checkbox by "Use all F1, F2, etc, keys as standard function keys" is NOT checked.
Next, click on the Show All button, and select Bluetooth. You should see your Apple Wireless Keyboard listed on the left side of the screen.
Click once to select it, and then click the gear icon at the bottom of the box, and choose Disconnect.
Power off the keyboard by holding down the power button on the keyboard for a few seconds until it show "keyboard Off on your imac screen, then turn it back on again.
The device should appear once again in your bluetooth list.
Try out the volume control buttons now, and see if that cleared things up