If changing your last name is legally required for reasons such as adoption, marriage, or other legal procedures, it is permissible in Islam. Islam allows flexibility in such matters as long as the intention is not to deceive, sever family ties, or choose a name that contradicts Islamic teachings.