Having spent a decade in education, and many of those years working with a body of students only 10% were at or above grade level (and I'm pretty sure that the metric didn't indicate any of the latter), I've seen the sort of rigidity you mention. Anyone who thinks education isn't primarily an exercise in psychology hasn't spent much time in the classroom. Given the poor way math is taught in the US, math is more psychological than most. The challenge to inculcate creative thinking in math is perhaps the challenge, so make sure you understand it yourself.
Why Math Students Are Rigid
In mathematics education, there has been a tension between fundamentalists (let's stick to the arithmetic/geometric fundamentals which generally means lots of rote memorization) and math education philosophies that look to enrich a child's conceptual understanding, like New Math and Common Core. I've found students often have psychological preferences much like the former, "fundamentalists" and "imaginative" thinkers. A "fundamentalist" tends to believe there's one way to do things, and that getting correct answers is important, whereas "imaginative" students are creative in their approaches (I had a secondary student essentially reinvent math pictographs) to do problems. The latter group of students likes to get right answers, but tends to prefer finding a way that makes sense to them.
The NCTM has criticized (rightfully IMNSHO) math education as a being a mile wide and an inch deep. Given the sequential nature of math, I think the rigid thinking of children (barring the occurrence in psychological disorders like OCPD) often hinges upon an emotional experience of math that might be described as a brutal series of rejections for students who show little talent for it or are deprived of a quality year of education, often at no fault of the student. A bad 3rd-grade math teacher may result in a struggle in math for the next 9 years, and for a child sensitive to failure, that's a lot of rejection. Standardized tests tend to exacerbate that rejection.
Changing Math Thinking
When I earned my math degree, I saw that the attitudes about math didn't change much from K to graduate classes. There's an absolute lack of wonder about mathematics. It's tough to bring about wonder, and some students just aren't gifted in math and fewer want to learn. Gauss on math education:
I have a true aversion to teaching. The perennial business of a professor of mathematics is only to teach the ABC of his science; most of the few pupils who go a step further, and usually to keep the metaphor, remain in the process of gathering information, become only Halbwisser [one who has superficial knowledge of the subject], for the rarer talents do not want to have themselves educated by lecture courses, but train themselves. And with this thankless work the professor loses his precious time.
Depending on the age of the student, you need to get into the student's head. With a senior in high school, you can just have the conversation about how why they do what they do, how they feel when they get wrong answers, etc. On the other hand, with a younger student, you have to be a little more indirect and infer. For most students who are rigid in their approach, it's simply a combination of poor math skills and a dislike-to-fear of failure. A rigid student is just clinging to an algorithm to avoid appearing completely ignorant, more often than not, and sadly, they've often been rewarded for it in the past. That's why so many people hate the Common Core: it doesn't focus on answers so much as reasoning, and well, critical thinking is hard work.
Once you have a sense of why it's so important for a student to stick to an algorithm, then, if you have good rapport with a student, persuade them to broaden their thinking. Math understanding comes from having a dialog, even with yourself when working on a problem, and students are conditioned to execute an algorithm than applying a series of heuristics. But, one thing that has been made clear is that mathematical problem solving involves defeasible reasoning. Math solutions are very much based on intuitions.
To develop a student's inner dialog to engage in problem-solving, it often helps to teach problem-solving strategies. George Polya's work on the matter is a good start. Some students (those with ADHD or impoverished grammars and vocabularies) struggle to solve math because they have a hard time reasoning through it. But I suspect, since the matter is an empirical question, that most students simply haven't had practice at it. When I taught, in my math department, of the 25 teachers, only 2 of us actually had math degrees, and new teachers often had little insight of the material. I suspect that's the norm in the US. You have to make use of teachable moments and role model math problem-solving.
As you may have heard, there is no royal road to geometry, but there are things you can do:
I had three practices in the classroom to encourage a child to understand that making mistakes in math is the norm (not the exception), and my students would complain. First, I used to make my students use pens instead of pencils because and they would protest that I'd see all of their mistakes; second, I would give vocabulary and writing assignments and assessments devoid of calculation. Third, I would give problems AND the answer and ask for work and rationale. You would think I was pulling teeth without analgesics. The usual rejoinder was "this isn't how you do math!" I ultimately had to flip the classroom, and I encountered this strategy in the university as well.
I'd say a good first start is to redesign your lesson and materials around the answer of getting from the givens to the conclusion. For instance, if your student is struggling with associativity in addition, give worksheets that ask for two ways to go from 3 + 6 + 9 to the answer 18. This way you're focusing on the path instead of the destination. Use graphic organizers. At the elementary level, if you have steps, you almost invariably have arrows and boxes meant to suggest what gets combined. Don't do a lot of problems, do a few problems repeatedly and well to encourage understanding. Teach non-standard algorithms. I can add three-digit numbers in my head, but that's because I've had a lot of practice with non-standard methods. Use lots of vocabulary including Q&A; when my child started addition, we talked about addends, adders, sums, and doubles as well as ten frames, groups, addition, combination, etc. Most of my at-risk high schoolers knew less math vocabulary than my 1st-grade daughter. Multiplication can be talked about as a product of factors, or more simply m groups of n. So, 3 x 2 = 6 is also three groups of two things is six things that are more concrete. Mathematics is terse, and it helps if you develop semantics to accompany that syntax.
I could go on, but there are lots of tricks to the trade, and most of them are specific to the type of math involved. Make problems concrete. For commutativity or transformations, I would talk about putting on socks and shoes (non-commutative). Methods like FOIL for products of binomials, mnemonic devices for memorization, games, etc. Teaching math is no different than repairing cars in that anyone can do it, but few can do it well. Ultimately, keep on developing your skills is the best long-term strategy. Being a math teacher is a lot like being a wizard, and you have to have a spell book of materials and techniques.