It can be appropriate.
The Latin phrase is requiescat in pace which translates to may he/she/it rest in peace. The abbreviation RIP also neatly lines up with the English phrase.
If others are replying "RIP" it is probably acceptable for you to respond that way as well. However, you should be careful of the context. It has become common to use "RIP" or especially "rip" (lowercase) to respond to things that are not nearly as bad as someone dying, as the Urban Dictionary entry shows. A similar meme is to reply "F" which is a reference to a video game; using this in response to news of an actual person's death would probably be quite impolite.
As @Lambie points out, if you are able to expand your response with a sentence or two about the person and how you knew them (or how they were important to you) that will ensure your reply is not interpreted the wrong way.
Of course there are other options, such as responding "That's terrible" or "I'm sorry to hear that" or other things that express your dismay.