Can a manifold have two different dimensions. We say that a manifold M is n-dimantional if it is locally Euclidean of dimension n,
specifically if a
point p in M has a neighborhood $U_p$ such that there is a homeomorphism f from $U_p$
onto an open subset of $\mathbb{R}^n$.
My question is, can it be n-dimensional in some neighborhood and m-dimensional in another neighborhood.

Are there such manifolds?
How can we constract one?
 A: On the other hand, if different senses of "dimension" are allowed the answer to the question in the title is yes, even for connected manifolds (and even for the same neighborhood). That is to say, it is not true that all notions of a dimension that can be coherently defined for a manifold have to coincide.
Examples for these come from subriemannian geometry; e.g. the Heisenberg group of upper triangular matrices with ones on the diagonal has three dimensions in the sense of local linear models but in terms of local nilpotent models it has four dimensions (more rigorously, its Hausdorff dimension is four with respect to its standard subriemannian metric).
A: The disjoint union of a circle and sphere would satisfy the condition that every point has a neighborhood homeomorphic to either $\mathbb{R}^1$ or $\mathbb{R}^2$. And perhaps some authors would want to include this space in the definition of manifold.
Practically speaking, however, it seems the first step to analyzing "manifolds" such as this one is to decompose them into their pure-dimensional components. So I think more often than not, $n$ is considered fixed over $M$.
A: Look for example at the definition of Manifold. This states a manifold is a topological space topological space. Implying that the definition of dimension is that of the topological spaces. The definition of topological space is derived from that of https://en.wikipedia.org/wiki/metric space.
In the text for metric space the generalization to metrizable measure spaces.
Less general ideas stem from the Euclidian space with is only locally existent in manifolds. The generalization of the Euclidean space is the Riemannian manifold. So in generality a metric space has not an obvious choice of a measure and so not of a dimension.
The example of Matthew Leingang uses therefore just the set theoretic notion. The sphere is embeded in $\mathbb R^{3}$. It has the dimension $2$ and is part of $\mathbb R^{3}$ which has dimension $3$. The sphere does not exist in lower or higher dimensions. There is a mathematical generalization since the sphere is a foundational mathematical construct of a zero-dimensional sphere, the point, a one-dimensional sphere, the straight line, a three-dimensional sphere in $\mathbb R^{4}$ and so on.
From this deductive reasoning on the sphere a naive concept of dimension may be derived. But it is strictly valid for this sphere objects and some of the corresponding embeddings like $\mathbb R^{n}$. This are still very naive conceptions.
For some more serious approach look for example at Thierry Vialar, Handbook of Mathematics chap. 14. Manifolds
"14.1 Definition. In this heading we introduce topological manifolds, the most basic type o f manifolds. (The  term "topological manifold" is generally used only to  emphasize that the kind of manifold under consideration is the kind we define here, in contrast to other kinds of manifolds that can be defined, such as differentiable manifold (smooth manifolds, analytic manifolds), complex manifolds, Finsler manifolds, or Riemannian manifolds.)
A non-example type definition is
"Def. 1709. (Topological manifold). Suppose M is  a topological space. W e say that M is a topological  manifold of dimension n or a topological n-manifold  if it has the following properties:
(1) M is a Hausdorff space: for every pair of distinct points p, q ∈ M, there are disjoint open subsets  U, V ⊆ M such that p ∈ U and q ∈ V.
(2) M is second-countable: there exists a countable basis for the topology of M.
(3) M is locally Euclidean of dimension n: each point  of M has a neighborhood that is homeomorphic to an  open subset of $\mathbb R^{n}$.  The property (3) means, more specifically, that for  each $p ∈ M$ we can find  an open subset U ⊆ M containing p.,  an open subset $U ⊆ \mathbb R^{n}$, and a homeomorphism φ: U → U.
from Vialar, Thierry. Handbook of Mathematics (S.753). HDBoM. Kindle-Version. "
So the dimension is the mightiness of the set of independent elements in the countable basis from (2)! This is connected with the attribute second-countable.
So the sphere of order n is second-countable in $\mathbb R^{n+1}$. That is very important for the example to hold!
There is a theorem called topological invariance of the dimension of manifolds. This states a nonempty n-dimensional manifold cannot be homeomorphic to an m-dimensional manifold unless $m=n$.
Euclidian spaces are locally homeomorphic to topological manifolds and therefore locally the dimension may be transferred from the Euclidian space to the topological manifold.
