Explanation:Firstly, what differentiates one cell from an another is the selective expression of the genes. It is agreed that brain too has the same gene for insulin synthesis as does the pancreas. That doesn't mean that the brain produces insulin, because either the brain cell is regulated in not translating the gene to the protein (insulin) or the produced protein is inactivated so as to turn it non-functional. And this process of repression/inhibition is the gamut of regulation of gene expression. Which is a huge topic unto itself.If all the cells in our body have the same DNA, then why aren't they all the same kind of cell? How can there be different cell types, shapes, and functions?
You are right when you say that all the cells have the same DNA (same set of genes).
But what differentiates one cell from an another is the selective expression of the genes. Agreed that brain too has the same gene for insulin synthesis as does the pancreas. That doesn't mean that the brain produces insulin, because either the brain cell is regulated in not translating the gene to the protein (insulin) or the produced protein is inactivated so as to turn it non-functional. And this process of repression/inhibition is the gamut of regulation of gene expression. Which is a huge topic unto itself.
This process of regulation of gene expression is not a peculiarity to humans but is found in all living cell. It may be either simple as can be seen by the lac operan concept for bacteria, or complex array of controls as in human gene expression.
And what should be given attention is that not always the gene is controlled but it can be its proteins (posttranslational), RNA (translational), the DNA beside the gene in question (promoter sequence concept).
For example, when a gene is methylated it stops expressing (commonly). And thus the cell can regulate specific sets of genes to be expressed, which defines the identity of that cell.