Can I be a resident of one state and work in another?

I am a permanent resident of Texas, but I took a position in a different department within the same company that has me working out of Arizona. I rent a room in Arizona but do not plan to live here permanently. Should I do my federal taxes with my Texas address or the Arizona address? And is it correct that I should file my state taxes as a non-resident?