I feel that your rational thinking must be very strong and you are good at math. But music can't be explained only by mathematics and physics, it needs more perceptual thinking, especially for beginners, so I want to make some suggestions:
First of all, you should feel the first key, that is, C major. Listen carefully and distinguish the auditory difference between the whole tone and the accompanying sound. Then you should silently sing 1234567(do re mi fa so) to keep the same pitch as the piano. 34 and 7 1 are semitones, and there is no key between semitones. That's all I need to know.
Look at G major again, and it also has its 1234567. 1 in g major is 5 in c major, so you only need to build a set of 1234567 on five notes in c major. If you can sing, you can definitely find it on the keys. So it is necessary to #4. In short, any bond can be regarded as 1. As long as you know how 1234567 sounds, you can set up a major in any key.
Any key can also be regarded as 6, and 67 123456 (Las do re mi fa so la) is a natural minor.
There is no bF (F-flat) key in classical music theory. If F is 1, it should also be called F-flat. To create the feeling of 1234567 in F flat, a black keys will pop up, but this black keys can't be called #6, but b7, so we can read the scale in F major as 1234566. It can also be pronounced as 456b 71234 (Fasola in Si Do Re Mi Fa), both of which are only pronounced correctly. The former is called the first tone singing method, and the latter is called the fixed tone singing method, which can be extended to all major and minor tones.
Then why can't there be #6 in F major and b7 in fixed mode? If the pronunciation is #6, its scale is 456#6 123, which is inconsistent with the sequence relationship of 1234567 in C major (the latter item is one more than the previous one). Hehe, the specific reason is the interval problem.
By the way, why not just set up a bF major? The result is too much trouble (MINUS fa, so, la, si, do, re, mi, fa). Make your own e major and see if it sounds the same as the so-called bF major.
1234567 corresponds to CDEFGAB.
I have to do my homework. Good luck.