OrigamiOrigami rapier and ballon shield.
The simplest way would be a flat, thin piece of triangular metal or plastic that folds several times along its length (along pre-machined lines), to form a somewhat stiff skewer. It will be more of a thrust than a cut-and thrust sword, think small sword or even rapier. The actual tip is manufactured from a hardened steel. The hilt provides a small mechanism that does the folding when drawn.
Such a weapon will be significantly weaker, structurally, than a solid sword, especially against blows against one of the flat sides of the material. It's conceivable that such a sword could be drawn and resheathed many times before material fatigue sets in, but it won't survive hard blade to blade contact.
It will be challengin to find a suitable fencing style: AFAIK many fightsstyles avoid blade-blade contact, but to my totally lay opinion especially fencing styled for thrusting sword like rapiers and smallswords do parry with the blade. For a fold up rapier, the wielder needs an additional defensive weapon:
The airbag shield:A Balloon of very tough material that is integrated in a solid glove. Upon command, a small explosive charge blows up the ballon (that stays, in away that is still to be properly desinged and engineered attached to the glove) which gives the wielder something to put between themself and incoming blows. The shield will be very unwieldy and won't have the mass to really block blows, but can cushion them and adsorb energy.
Stabs pose a real danger of puncturing the shield. The inside is engineered to stick to intruding objects, the ballon readily crumples once deflated, all in hope to trape the weapon - there's a chance that a solid stab with a spear or rapier goes right throu shield and wielder, but if the stab misses the shield-wielder or the weapon is simply too short, the attacker cannot quickly escape.