Writing something for someone else and getting paid for it is a standard practice in many industries, and it is considered genuine freelance work and not illegal.