How does Universal Generalization agree with facts? The law of Universal Generalization states that: 
P(c)
(x) P(x) 
Now, I understand that this works only if c is any random element from the universe. Such arbitrary selection makes this rule mathematically valid. However, I do not understand how it holds true in practical examples. 
For instance, if I randomly pick out a number from the set of the integers 1 to 10 and it turns out to be a prime number, I can infer using Universal Generalization that all the numbers in the set are prime. But this would be a fallacious conclusion. How then, can the law be used in practice? 
 A: It's not "I pick a random $c$ and if it's true for $c$, then it's true for all $x$"
It's "If I know it's true for $c$ even if I don't know which $c$ I have, then it's true for all $x$".

In other words, your example should be:

If you tell me you will give me a random number from the set of integers, and I can already be certain that the number will be a prime number, then I can infer that all numbers of the set are prime.

And this, of course, is not true, since if all you know is that you will get an integer smaller than $100$, you can't conclude you will get a prime.
A: The rule requires $c$ not to be mentioned in the prerequisites of the theory or any assumptions made. This means that it is a symbol whose meaning hasn't been restricted in any way. It is this lack of restriction that makes it possible to generalize.
If $P(c)$ can be proved with a $c$ in such a theory it would be able to reproduce the same steps with any other symbol as well and the proof would be valid. 
So it's not about actually picking a specimen when using this. At most one uses some kind of restriction on the symbol that will then become a restriction of the generalization - for example a proof can start with letting $c$ be a positive real number and then using that assumption you prove $P(c)$. Then the generalization would need to be restricted as $\forall x\in\mathbb R^+: P(x)$.
If you acctually pick a specimen you restrict the symbol to the extreme. The generalization would be to the point of meaningless - you basically can come to something like "any integer equal to seven is a prime", not much of a generalisation.
