In general a change of ownership will not invalidate a lease; the new owner takes subject to existing tenancies. Many owners don't know this and expect tenants to get out upon purchase but they are mistaken. Unless these people violate a lease term, or if there is not a written lease, fail to pay rent, they cannot be evicted upon a change of ownership.
Note also that many CA communities have rent control ordinances. These laws usually strengthen the tenant's rights, especially in this situation. I don't know if Long Beach has such an ordinance or not but it's worth checking out.