Question: If we add a last digit to the code $C$ of length $n$, we obtain a new code called extended code. My question is:

> 
> If the code $C$ is linear, can we prove that the extended code $C'$ is linear too?
> 
> 
>

Answer: 
If you add an extra $0$ to every code word, we will have a linear code, with the same minimum distance. Just adding any digit won't give a linear code in general. I suppose if you start with a basis for the code you can add an arbitrary digit to each basis element and then extend linearly to the other code words, and get better distance properties, in principle.
A typical extension is to add an overall parity check symbol to $C$, meaning that after the extension, the sum of the entries of any codeword in $C'$ equals $0$. This extended code $C'$ is indeed linear (since the extension rule is linear).

If you just add random symbols, in general $C'$ is not linear.

In general, the extended code C′ is linear if and only if the map $C\to\mathbb F\_ q$, mapping a codeword to its extension symbol is linear.