Yes you can freeze tofu. You probably want to slice it first. Drain off ALL the liquid and get it as dry as possible with paper towels or a kitchen towel. When you freeze it the tofu might change colors. It can turn yellow which is fine it doesn't harm the tofu. It also gets a different texture, it's chewier. I would only freeze firm or extra firm tofu.
I personally wouldn't leave it in the refrigerator for more than a week. If you're storing it in the fridge leave it in the liquid.