On Weblio (http://ejje.weblio.jp/content/身を削る), the example sentence 未亡人は骨身を削る思いでその辛い仕事をしている is translated as "The widow is slaving away at the painful job."
I know that 身を削る can mean to undergo hardship, but what's the function of 思いで in this sentence?
It is 思い+で, literally "with [that] thought/feeling/intention/state-of-mind". What might have confused you is that で is the particle で, it is not the word 思い出.
身を削る is not supposed to be taken literally, it is the thought that counts.