Sympathetic cooling and detection of a hot trapped ion by a cold one