why does my printer always go off line? how do i fix it so it stops doing that?

HP Deskjet F4500 Series the printer. When I go to print, the printer is always offline. I either have to unplug my modem/router etc and then plug it all back in to get the printer back on line, but when I do this, then my TV has to reboot/reload, too. I don't like to have to do this. Or, I have to connect the USB cable to the printer to print. FYI, I don't leave my printer on all the time. I only turn it on when I want to use it. How can I fix it so it isn't off line everytime I turn it back on?