Showing Post ID on RSS

You can add the ID as custom tag to your feed via hook. But it give no valid tag in the rss/atom standard to store this. So that I think you should split the guid tag to get the ID of a post, like the follow example.

The guid inside the feed:

<guid isPermaLink="false">https://www.ciusan.com/?p=3566</guid>

Split the ID.

$id = explode( '=', $guid );

The var $guid should you enhance in your foreach loop, so that it store each guid to each item. The $id get a array with all strings there a split by the string =, also your post id.