What will happen with cached index or table when it is modified, will it stay in cache? if PostgreSQL loads something (for example an index) into cache, what happens if it (cached index) gets modified? Is it going to be removed from cache or not?
If by cache you mean shared_buffers, no, it won't be removed from there due to being changed.  shared_buffers is the primary place where it does get changed.  From there it will eventually get pushed out to the kernel, and then from there to disk.