How can I define where the camera in a 2D game hits a "wall" and stops?

You know how at the beginning of a level in an old school platformer, the camera stays still if you move to the left and only follows you if you move to the right? How do you guys recommend I do this in Unity? How can I define areas in the scene that the camera should never be able to see?

In your camera following script you can do something like

if(transform.position.x > min_X && transform.position.x < max_X) // if the camera's x value is greater than the variable min_X and less than max_X
{
    // follow player
}