Yes, the tofu that you buy at the store is already cooked in the process of turning the soybeans into tofu.  It is safe to eat out of the package as long as it has been stored correctly. (You can read more about the benefits and risks of eating tofu.   However, if your tofu is discolored, pink, slimy, or smells bad, it has spoiled and you need to throw it out.