Ethanoic acid, more commonly known as acetic acid, if performed electrolysis upon, would probably break apart to form hydrogen, and acetate ions, as shown below:
CH3COOH (insert reaction arrow here) H+ + CH3COO-
Hypothetically speaking, the hydrogen would bubble up, from the anode, while acetate ions, would be despelled from the cathode. Then, depending on the metal in use, (generally speaking) the acetate ions would react with the cathode metal, to form that metal's acetate. For example, were one to use use copper, as a cathode, the resulting compound would be CuOOCCH3, copper acetate.
In regards to your second question, the sodium hydroxide would (based upon the concentrations) would either neutralize, or be neutralized by the ethanoic acid, as shown in the reaction below.
CH3COOH + NaOH (insert reaction arrow here) NaCH3COO + H2O
As you can see, a neutralization reaction occured, forming sodium acetate and water.
In regards to your last question, this I am unsure of, as magnesium, generally forms an outer layer of oxidation (rust) to protect the rest of the compound. (MgO) However, upon contact with moisture, this forms Mg(OH)2, as in the figure shown below:
MgO + H2O > Mg(OH)2
As such, were one to use this practical application, the magnesium hydroxide, would react, as shown below:
Mg(OH)2 + 2CH3COOH > Mg(CH3COO)2 + 2H2O
Having destroyed the outer oxide layer, the ethanoic acid would then react with the pure magnesium, breakinjg it down, as shown below;
Mg + 2CH3COOH > Mg(CH3COO)2 + H2
This process would then form magnesium acetate, and hydrogen gas.
Hope this helps!
,Theophrastus