'Form' and 'function' are two extremely important concepts that you need to know about to fully understand how grammar works. Surprisingly, there is no overt reference to these terms in the UK National Curriculum.
'Form' refers to the category labels we use for the building blocks of grammar, i.e. word classes, phrases, and clauses. Consider the following sentence:
My daughter bought a completely useless smartphone over the summer.
Scanning this sentence from left to right we can label each individual word as follows:
my: determiner
daughter: noun
bought: verb
a: determiner
completely: adverb
new: adjective
smartphone: noun
over: preposition
the: determiner
summer: noun
All the word class labels above are referred to as grammatical form labels. Still talking about form, we can also say that:
my daughter is a noun phrase
a completely useless smartphone is also a noun phrase
over the summer is a preposition phrase
The terms 'noun phrase', 'preposition phrase', etc. are also grammatical form labels.
Digging deeper into the phrases a completely useless smartphone and over the summer we can also say that:
completely useless is an adjective phrase within the larger noun phrase a completely useless smartphone
with the preposition phrase over the summer we have an embedded noun phrase, namely the summer
(In some grammars we also have verb phrases such that bought on its own forms a verb phrase or, if the direct object is included in the verb phrase, bought a new smartphone. The National Curriculum doesn't recognise verb phrases as such. Instead verbs are regarded as the Heads of clauses. For some further explanation, look here.)
In summary, when we are talking about form, we are talking about structure. We can visualise structure using what linguists call tree diagrams. For a completely useless smartphone the tree looks like this:

We are also taking about form when we have subordination in a phrase or clause. So, in the following example the string that she lives in Leicester is a subordinate clause:
I know that she lives in Leicester.
'Subordinate clause' is a further example of a grammatical form label.
There's more to say about form, but for now this will do.
What about 'function'? It is important to be aware that this label is actually ambiguous: it can have a general sense and a grammatical sense. These are often confused.
Let's look at the general sense first. Consider the utterance below:
Fortunately, the pain went away very quickly.
The word fortunately in this sentence is an adverb that has a pragmatic function: it signals that the speaker views what follows (namely the pain going away quickly) as a good thing.
Very in the adverb phrase very quickly is also an adverb which functions in a general sense to 'intensify' the meaning of the adverb quickly. So from a general functional point of view we can say that this word is an intensifier. This can be called a semantic function.
Turning now to the grammatical sense of 'function' (which is actually best referred to as 'grammatical function'), we need to say different things about the sentence above.
Taking the word fortunately again, this time we say that its grammatical function is Adverbial. Words and phrases that have the grammatical function of Adverbial modify a particular unit in a sentence. In this case fortunately modifies an entire clause. In the example sentence very quickly also has the grammatical function of Adverbial, but in this case it modifies the verb go. More specifically, it expresses the manner in which the pain went away. Adverbials can also express other meanings, e.g. location and time, as in these examples:
We had a picnic in the park (preposition phrase functioning as Adverbial)
They left Hong Kong last week (noun phrase functioning as Adverbial)
Apart from Adverbial, other familiar grammatical function labels are Subject, Object and Complement (which includes Subject complement and Object complement).
The conclusion from all this is that we need to be careful when we use the word 'function' when talking about language and grammar. It's important to make clear whether we are talking about general functions, such as 'disapproving', 'commenting', 'intensifying', and the like, or about grammatical functions, such as Subject, Object and Adverbial.
See also: Form and function (2), Adverb and adverbial