In a normal sentence, the verb follows the subject:
You can speak French.
When the subject follows the auxilliary verb, as is the case for questions, this is called INVERSION:
Can you speak French?
INVERSION also happens in other sentence structures, and is an effective method of giving emphasis to an idea. It is often used with conditional sentences of HAD, WERE and SHOULD:
If I WERE you, I would do my homework (normal conditional)
WERE I you, I would do my homework (with inversion)
If I HAD studied I would have passed. (normal conditional)
HAD I studied, I would have passed. (with inversion)
If YOU SHOULD see Joe, give him this. (normal conditional)
SHOULD YOU see Joe, give him this. (with inversion)
It is also used in formal writing when an adverb with negative meaning is used:
I seldom eat fish. (normal)
Seldom do I eat fish. (inversion)
I have never seen such an animal. (normal)
Never have I seen such an animal. (inversion)
Inversion also happens when we use UNDER NO CIRCUMSTANCE or NOT ONLY BUT ALSO:
Under no circumstances will I pay for that.(inversion)
Not only did he call, but he also apologised.(inversion)
FRONTING is when something that normally goes at the back of a sentence is brought to the front for emphasis:
The keys were on the table. (normal position)
On the table were the keys. (fronting )
On the table were the keys. (inversion)
Notice that by using FRONTING we have also used INVERSION, as they often go together.