OK, this is how it would work in the UK: you would apply to HMRC, tell them what you want to do and apply for an A1 portable health document. If issued, this would then mean that you continue paying social security contributions to the UK and the UK would continue to cover your healthcare. This would make you legal to work in France and if challenged, the French authorities will accept the A1.
The process should be similar in Germany since this is an EU arramgement, so I guess you’ll know who to apply, it will be whatever authority you deal with for tax / social security.
AFAIK that’s the only legal way to do it. Freedom of movement makes a clear distinction between being a visitor in a country and being a worker, and you don’t have the right to earn money when you’re there as a visitor. The A1 document would give you posted worker status. Also, technically you’re only allowed to stay as a visitor in another EU state for 3 months maximum, so having an A1 would solve this problem too.
Having said all that it still hasn’t entirely answered your question because I’m not sure whether you would have to register yourself in France. I know that posted workers sent by their employer have to be registered on the SIPSI database https://www.sipsi.travail.gouv.fr/SipsiCasFo/login?service=https%3A%2F%2Fwww.sipsi.travail.gouv.fr%2FSipsiFO but I don’t think this applies if you’re self employed but I’m not 100% sure. Maybe Germany can advise on this.