You do not necessarily have to buy a router but it does simplify things y not having to switch the ethernet cable around every time you want either the PS3 or the computer online.
Try powering down the modem for a few seconds and then plug it in again. It maybe still had to "let go" of the IP address that was given to your computer before you made the switch.