Most often, you cannot figure out what the resolution of an image is.
If you are using a better-quality camera in auto-focus mode, the EXIF information might include the distance to the focus. If you have that and the lens aperture, then by knowing the height and width in pixels, you can calculate the angle subtended by the pixel range, and thus the angular resolution. (Perhaps you do not need the aperture; I have forgotten the details of the calculation.)
If you are using a medical device such as CT or MRI, then the images for those are usually created as DICOM images, for which there is DICOM meta-data that includes the resolution in the PixelWidth tag.