Do mathematicians Switch Fields of Expertise?
Solution 1:
I think it's rare for people to make a radical shift all at once, largely because it takes a long time to master a field. However, it is much more common to start in field $X$, get interested in an adjacent field $X'$, then in an adjacent field $X''$, etc. Iterate this enough times, and you end up someplace quite different from where you started.
If you are interested in working in a field which is a little different from your usual one, the best way is to seek out a collaborator in that field. Probably my most productive collaboration started because I got interested in a problem in a field in which I was not an expert and approached someone who was.
Solution 2:
If you define "area of expertise" narrowly, then all mathematicians change areas of expertise. It's extremely rare for people to focus on only one kind of problem. If you look at the publications of anyone who has been publishing for decades, you will see considerable drift in what they work on.
If you define "area of expertise" broadly, I think you will find that most people do not change areas of expertise. Rather than "expertise", it might be more accurate to talk about interest. Most people's broad mathematical interests do not change that much. If someone doesn't care about geometry at age 30, you will probably not find them doing geometry at 50. If someone is steeped in geometry in their 20s, what they do in their 50s often has a geometrical "flavor" even if is not pure geometry. The methods and tools that people use change a lot, sometimes drastically. But the underlying interests tend not to. There are exceptions, of course, but that's why people notice them--- they're exceptional. Nobody is astonished to see an geometer, broadly defined, stay an geometer.
All of the abrupt shifters I personally know switched shortly after grad school. These shifts often occur because one's focus in grad school is determined more by the environment (e.g. an advisor, the faculty at at a single school) than the individual. It takes years to develop mathematical tastes. In the meantime you sort of adopt, or try out, the tastes of the people you are learning from. It's not unusual for a grad student to accumulate enough material for a dissertation in area X, while in realizing in the process that they are more interested in Y. So you see CVs where someone does a thesis and a handful of papers in X, and suddenly it's just Y after that.
You ask if researchers shift to "conform to the type of research done at their institution." I would say a definite no to this. At research universities you do have to conform (at least partially) to get hired in the first place. If you look at mathjobs.org, for example, you will see that research universities usually specify (at least partially) a research area in job announcements. So: if you don't conform a little, you don't get hired--- or, more likely, you don't apply in the first place. If you are hired then you have interests in common with at least some faculty, and it's natural that you might work with them. But generally speaking, once you're hired, nobody really cares what your research direction is, provided that you have one (and are otherwise playing an active role in the department). If you only publish sole-authored papers, or only publish with people from universities besides the one that you work for, no reasonable person will hold that against you. There is no pressure to conform in the sense that I think you are asking about.
A final thing, on your choice of words in "how mathematicians stake out the fields they will be producing research in." Generally mathematicians do not choose a field first and then begin producing research (except perhaps at the very beginning, ie grad school). Research problems come first, and over time, depending on what the perspectives and tools one acquires, one finds oneself situated in a given field. For example, it's rare for someone who has not done X in the past to just wake up and say "OK, I'm going to do X now." What's more common is they will be working on a problem that isn't explicitly about X, and in trying to solve it, they eventually realize (or learn form someone else) that some X might help. So they go and study X a bit. Sometimes this leads to a solution to the original problem, and case closed, and they don't think about X ever again. And sometimes it's a dead end. But sometimes it leads to them reading the literature on X, thinking about X more often, maybe eventually contributing to the literature on X. This is the kind of gradual shift of interests Adam Smith talked about in his answer. It doesn't generally arise out of a conscious desire to switch fields or to "stake out" a field. It just happens.