It’s always very hard to help with behavior problems at a distance. But based on the cat "hiding" under your bed and hissing at you, I’d say it’s simply scared. It certainly sounds like the cat is displaying
fear aggression.
Why the cat would be comfortable and trusting with you when it first entered your home but then changed, I have no idea. One possibility is that your cat and this cat have met (while you were sleeping?) and it didn’t go well. But whatever the cause was, since you’ve got to deal with the situation for three more weeks the best suggestion I can give is ignore the cat as much as possible. Give it space and hopefully, with time, it will adjust to its new surroundings.
If you attempt to interact with it the cat is likely to interpret this as aggression on your part. So the best thing to do in these situations is to try to ignore the cat.
Cats can interpret an unblinking stare as aggression. (If you've ever seen two feral cats meet they will often start by simply sitting and staring at each other. Each is trying to intimidate ... stare down ... the other.) Try not to look directly at the cat or look at it through half-closed eyes.
Slow blinking is also said to help relax a cat. (Hey, it's worth a try, no?)
Make sure food, clean water, and
especially a litter box are available in your bedroom. Move anything the cat might damage, for example knick-nacks on a dresser that might be damaged if knocked to the floor. Then leave, close the door and let the cat be. If you have a radio in the room you might consider leaving it set at a low volume to a local classical music station. Check the food, water, and litter once or twice a day, but otherwise just give the cat space so it feels secure enough to calm down.
If you’ve got a studio apartment then I’m not sure what to tell you other than to try to partition off an area in it where the cat would feel safe to come out for food and to use the litter box. You can sometimes fashion something ugly, but adequate enough from large cardboard boxes thrown out by supermarkets and other stores.
Here’s a link to the
brochures web page at the Cornell Feline Health Center. It’s possible that their
Feline Behavior Problems: Aggression brochure may have ideas that are useful to you.
Good luck and please let us know how this turns out.