You're right, unfortunately, the current version of CKAN (2.2.1) does not include package_id when you call resource_show, and there is no call to resource_group_show. If you are writing an extension, you can work around this by running a direct database query:
SELECT resource_group.package_id FROM resource, resource_group WHERE resource.id='<resource_id>' AND resource.resource_group_id=resource_group.id;
If you are trying to get package_id using the API, the only way to find it is to look from top to bottom, call package_list, then package_show for each, until you find the one that contains the corresponding resource_id.
source share