Here is the correct order of this event is:
1. France established colonies in Indochina
2. France fights communist forces in Indochina
3. France and the United States (U.S) supported an unpopular government in South Vietnam
4. Vietnamese communists declare independence
5. France recognizes an independent North Vietnam
France managed to colonize Vietnam, as well as other parts of Indochina in a very well planned, and gradual, systematic taking over. After some time, the nations in Indochina, including Vietnam, started to rebel against the French, thus multiple battles occurred. The forces fighting for liberation of Vietnam were mostly with a communist ideology.
The French, as well as the USA, were supporting an unpopular traditional leader of Vietnam, which didn't really help their cause, apart from managing to extend their influence in part of Vietnam a bit longer.
The communist where victorious though, and they managed to gain full control of North Vietnam. The French had no other option than recognizing North Vietnam, and avoid further troubles.