On the back of an underwhelming 2010 and 2011, Massa scored just two points from the opening five races in 2012 while team-mate Fernando Alonso led the championship.
"Yeah. I thought about so many things. I thought maybe I was finished," he told BBC Sport.
"I thought about not staying in Ferrari."
"I did not know what would happen. So many things were inside my brain."
However, Massa's form improved and he finished seventh in the championship, which including two podiums in Japan and at home in Brazil. He revealed that he spoke with a psychologist and credits his family for his improved form.
"I talked to everyone. But I also did work with a professional psychologist, sporting psychologist. That was just the beginning. After that I was able to change the direction to think, the direction to work and I think it was like training I did. But also I think my family helps, definitely 100%."
"The result is the most important thing. If you are able to show things change very quickly in F1, people who are sure you are finished they say different things after. Many people said I was just using fuel at the beginning of the year and then after they want me to stay in Ferrari because it was the best option. It is important to work to get the good result. If you have that nothing else is important."
Massa's strong pace towards the end of 2012 has led the Brazilian to enter 2013 in a confident frame of mind, despite lining up once again alongside Fernando Alonso, who he regards as his toughest team mate.
"I am very confident I can be in good shape, which I was [at the end of 2012] even if it was not winning the race. But we did not have the car."
""I think I had more difficult times with Fernando, so I would say Fernando was the strongest team-mate for me," added the Brazilian, who has also been team-mates with Jacques Villeneuve, Michael Schumacher and Kimi Raikkonen.
"But you learn with everybody. I learn a lot with Michael, with Kimi and Fernando."