For civil servants working for the Ministry of Interior (which was in charge of the Stasi, the secret police) it was decided on a case-by-case basis. Known members of the Stasi were all let go. Rank and file police (not officers) were sometimes allowed to stay, it depended how heavily they used to be embroiled with the system. Professional firefighters were allowed to stay, but their numbers were drastically cut.
For other civil servants it depended upon the entity they were working for. East Germany got a totally new political system and the new departments were basically free to hire whomever they liked provided the person was not a former member of the Stasi. For convenience sake they often kept the old staff, but many were let go.
Teachers for example were employed by the GDR Ministry of Education and got their orders from the local office of the ministry. After reunification they were employed by their federal state's Ministry of Education. Not sure whether their old contracts were grandfathered in or whether they got new contracts (my relative was on extended maternal leave and was let go in the chaos), but my guess is that they got new contracts.
Factory jobs - in the GDR most companies were owned by the state. After the GDR ceased to exist, all companies were now owned by the Federal Republic of Germany. For convenience sake the West German government created a trust fund called Treuhand. The Treuhand was supposed to help the old East German factories go from one system to the other, but in reality nobody really knew what was going on inside the Treuhand. In many cases companies that used to be worth millions got sold for the symbolic price of 1 (one!) Deutschmark to an investor in the hopes that this investor would modernise everything. In many cases nothing happened and the investor was left with valueable real estate. Billions dissappeared into dubious channels.
Only a handful of East German companies sort-of survived and these are often companies that got founded by former employees without any support from the Treuhand and or the government.
The most successful stories are those where big West German companies took over their East German counterparts and were serious about investing and modernising things.
Still, the numbers of factory workers dropped drastically. The old East German factories relied on people to do the work the aged machines could not. They also relied on people to compensate for the broken system of real-life socialism. For example, one of the leading pharmaceutical companies in the GDR had to employ glassblowers because they could not buy test tubes and other necessary glassware anywhere. Ten people that were let go immediately after reunification because now test tubes were easily available for very little money.
As a result unemployment in the mid-1990s in East Germany was hoovering around 20%, in some areas up to 25% while it was around 5% in West Germany.
Pensions are a complicated issue. The decision was made that the pension contributions people living in the GDR made into the system in the GDR would count towards their pensions in the West German system. However since wages in the GDR were drastically different, they came up with a very complicated formula that still causes misunderstandings on both sides. It would go too far to cover this here unless you really want to know more about this.