What to do with my old bike? I have an old, cheap, second hand bike which I use for commuting. I have to leave it on the street for 10 hours every day, it is old with damaged stickers and dirty which makes it less likely to be stolen. 

It is in awful condition though. It's previous owner drove his car over it or something. It had broken brakes, a broken back derailleur and damaged front derailleur. Worst of all is something I didn't notice at first: a bent frame. 

I have already spent more money in repairs than what I spent in purchasing the bike to begin with. In my last inspection I found that the back hub is also loose, I think it is related to the frame being bent. The thing is, I still want to be able to ride it to work and I don't want it to get stolen or damaged. 

So what are the best options for me? 

Is it a good idea for me to replace the frame? (without previous experience) 

I tried to find a donor bike but I don't feel confident in buying another one second hand. I also don't feel comfortable leaving a new bike on the street for long.
If I do not easily notice a bent frame at first sight, it tells me it cannot not be that bad to compromise the frame integrity. When you ride the bike, do you feel it handling weird, or shaky? if it doesn't, then I would conclude the bent frame is inconsequential. Personally, one of my bikes has a bent frame which I didn't noticed it for the first few months. Been riding it for 4 years since then and it's never been issue in handling or otherwise and I've ridden in long rides (15-20+ miles) and at considerable speeds (17-19 mph)

The loose hub, as it has been mentioned before, it could as easy as tightening the bearings cups or as bad as needing a new hub. Without a video or personally inspecting it, it hard to give proper advice. 

If the frame is toasted, I would consider two options: donate it to a bike co-op so it can be used for spare parts; or find a similar bike on CL and keep this one for spare parts.

Also, a bike co-op will work with you to either fix your bike or allow you to pick another one in exchange for the one you have.