If an airline purchases an aircraft, do they have to/feel compelled to change the livery? If an airline purchases a used commercial aircraft, which would be painted in the livery of its previous owner, would the new airline ever be required (by law) to re-paint the aircraft in their own livery?

I am also curious what happens if a private individual were to purchase a used aircraft from an airline, again painted in their livery. Would they be allowed to fly it for some time still bearing the livery of the airline that used to own it?

If there is no law regarding this, then is there a general practice? I.e. most airlines would just keep the old livery until the airplane is due to be re-painted?
Yes - logos, trading names, liveries etc are all covered by trademark and you would need permission from the trademark owner to use them yourself. Besides, the schemes are good marketing so a commercial operator would want their own livery on it as soon as practical.