By default you need to press fn+F key instead of just pressing the F key.
Enable the F keys to editing /etc/modprobe.d/hid_apple.conf
and adding the following:
options hid_apple fnmode=2
Then edit /etc/dracut.conf.d/hid_apple.conf
and add the following:
install_items+=/etc/modprobe.d/hid_apple.conf
Then run: dracut --force
and reboot.