4-Vector Potential, transformation under Lorenz Gauge I am given an initial vector potential let's say:
\begin{equation}
 \vec{A} = \begin{pmatrix}
   g(t,x)\\
   f(t,y)\\
   0\\
   g(t,x)\\
\end{pmatrix}
\end{equation}
 A: i think you are misunderstanding slightly, to obtain your potentials, you must have a specific chosen gauge that these potentials satisfy already.
Suppose my vector potential satisfies a specific gauge already,
$$\nabla \cdot \vec{A} = G(x,y,z,t)$$
I now perform a gauge transformation,
$\vec{A} \rightarrow \vec{A}'$ such that:
$\vec{A}' = \vec{A} +\nabla f$
$\phi' = \phi -\frac{\partial f}{\partial t}$
These leave the field invariant
Suppose that these transformations also  satisfy:
$\nabla \cdot \vec{A}' +\frac{1}{c^2}\frac{\partial\phi'}{\partial t}=0$
substitute the definition of the transformed potentials  $\vec{A}' \phi'$ into our expression:
$\nabla \cdot [\vec{A} +\nabla f] +\frac{1}{c^2}\frac{\partial[\phi -\frac{\partial f}{\partial t}]}{\partial t}=0$
$\nabla \cdot \vec{A} + \nabla^2f + \frac{1}{c^2}\frac{\partial \phi}{\partial t} -\frac{1}{c^2} \frac{\partial^2f}{\partial t^2} = 0$
$  \nabla^2f  -\frac{1}{c^2} \frac{\partial^2f}{\partial t^2} = -[\nabla \cdot \vec{A}  + \frac{1}{c^2}\frac{\partial \phi}{\partial t}]$
Here we have an equation for f, that would need to be used in order to transform our potentials in the lorentz gauge.
Plugging in our known value for the original gauge that my untransformed potentials satify ( something which you havent mentioned yet), and time derivative for the scalar potential we obtain our f.
From our obtained value of f, we then transform the potentials that we have defined earlier.
$\vec{A}' = \vec{A} +\nabla f$
Our new potential $\vec{A}'$ thus satisfies the lorentz gauge whilst leaving the field B invariant.
