I want to know if the root user can read from and write to sections of kernel code in memory. Can it?
Yes, usually the root user has sufficient privileges to modify kernel code indirectly, although there are mechanisms that can be used to restrict this, assuming sufficient security measures are taken into account. A non-exhaustive list of ways a privileged root user can modify kernel code:
iopl()syscalls can set I/O port permissions.
Naturally, files in the boot directory (including the kernel) can be modified.
/dev/portcharacter devices allow direct memory access.
Various MSRs can be used to change low-level CPU behavior, breaking security.
kexecfunctionality can be used to boot into a new kernel.
ACPI tables can be loaded by root at runtime, executing AML in the kernel.
custom_methodcan be abused to write directly to memory.
Kernel modules can be loaded by root if module signing is disabled.
Debugging features like kprobes can modify kernel behavior.
Mitigation can be done either by using a hardened kernel such as properly configured grsecurity, or by using the kernel lockdown patches which are to be upstreamed soon. It is still necessary to prevent the root user from writing to the bootloader or boot partition where the kernels live, of course.