Why would Ke$ha be writing songs in rehab? I wouldn't be surprised if she is, but I also wouldn't be surprised if she isn't.
There isn't much to do in rehab and its already known that she was bored in the first couple weeks when she wanted teeth to be sent to her. And its not like she doesn't like to write either