If I play C E G on the piano, then G acts as a perfect 5th, but if I play G C E and the lowest note (just below the C) is G, can I still call G a perfect 5th of C maj? Because the interval now between G and C is 5 semitones i.e. perfect 4th.
Watch out for the distinction between an interval above a pitch and the chordal member. G is a perfect fifth (an interval) above C, but it's also the chordal 5th of a C chord.
Intervals are always measured from the bottom note. So when you measure the interval from C up to G, you always count in that direction.
But when you place the G below the C, now you count the interval from G up to C, thus (
G–A–B–C) it's a fourth.
You've stumbled upon what we call intervallic inversion and its corollary the Rule of 9. In short, when you invert an interval, you move the upper pitch so that it's now on bottom; the resulting interval is the original interval subtracted from 9.
In other words, you started with a fifth from C to G. When you invert that interval, it becomes a (9 - 5 = ) 4th.
There's also a pattern of qualities and how they change during intervallic inversion:
Major becomes Minor, and vice versa
Diminished becomes Augmented, and vice versa
Perfect stays Perfect
But if you're not identifying interval qualities yet, don't worry about it!
What is confusing you is that a note by itself isn't the start point for intervals. We always count up from the lower note. Thus, the distance between C and G isn't the same as that between G and C. Sounds confusing? Once you've established which note is lower, then count up to give the number relevant to the interval. C-D-E-F-G gives a perfect fifth (P5), whereas G-A-B-C gives a perfect fourth (P4).
An interval is the space between two given notes. So, yes, using the lower one as C, C>G is a P5. With G as the lower note, G>C is a P4. Note (sic) the 'rule of 9'.
Any two notes will have two different interval names, depending Which you consider the lower. Thus, C>E is M£, while E>C is m6.
And - don't be fooled by merely counting semitones. C>E is M3, while C>Fb is diminished 4...