How to learn developing the formal proof of statements or theorems? This is not a math problem, but something that this platform can provide answers to.
I am a student of math. I learn and understand the concepts.
However, when I see some statements I understand how they're true, but when somebody asks me to prove it formally I fail there.
I want to ask how to develop the technique of writing formal proofs of statements.  
What is the way? By just looking at others' formal proofs?
 A: It's very common to see a proposition/theorem that looks extremely intuitive, but hard to prove formally. Sometimes this is, in fact, the case! Major results like the Jordan curve theorem are completely obvious to a layman, but extremely non-trivial to prove rigorously.
On the other hand, you shouldn't expect to see this kind of problem where you appear to be now (linear algebra/real analysis?). Often times, the best way to begin attacking a problem formally (once you have a good intuition for the statement) is nothing more than to list out all of the definitions. For every relevant definition to the statement, meticulously state it on paper. You'll be surprised how often a common pattern will appear which you can exploit in your argument!
A: As others have said, it's important to read proofs in detail in the material you're studying. 
Also, you need to write your own proofs. Ideally, you would obtain feedback from a competent teacher on everything you wrote. Since this usually isn't feasible in practice, the next best thing is a problem book with detailed solutions. Write your own solution to a problem, and then compare it with the book's solution. Of course, it is often possible to write a solution that is completely different from the book's, but is equally correct. Nonetheless, the process of comparing your solution with the book's frequently reveals major errors in your own proof, points at which you've left out an important argument, or details which you ought to have mentioned but didn't.
Often a problem arises when a student moves from primarily computational math courses to ones in which proofs are unavoidable, such as analysis or abstract algebra. In this situation, one difficulty in learning proofs can be that you are fighting a battle on two fronts at once: (1) learning how to write proofs; (2) learning material that involves many new concepts, and that may be difficult in its own right. 
For some students, this isn't a big problem, but for most, it helps to gain experience with proofs first in the context of familiar objects and concepts, such as whole numbers, inequalities, geometry, etc. There are a couple of resources that can help in this case:
(1) Books with proofs that are targeted at high school students, such as those in the MAA's Anneli Lax New Mathematical Library. For people who can read Russian, the website math.ru has many free books on elementary subjects (mostly published works that can legally be freely distributed).
(2) A well-written "transition to higher mathematics" textbook. The best one I know of is Rotman's Journey into Mathematics. The material in it is both interesting and elementary, and it has a detailed solutions manual available for free. Unless your tastes lead you to them, I would avoid books of this category that focus primarily on the formal foundations of mathematics, such as logic and sets. While these are important, it's usually better to learn about them in the context of studying material you find interesting anyway. (Studying logic and set theory in depth is usually much more fruitful if you return to them once you've learned, through practice, how to adopt a mathematical mindset.)
