Trivial Solution for Energy Momentum Equation In special relativity we define momentum as 
$$
\frac{m v } {\sqrt{1 - v^2 / c^2}} \tag{1} \label{1}
$$ 
and energy as 
$$
E = \frac{m c^2 }  {\sqrt {1 - v^2 / c^2}}  \tag{2} \label{2}
$$
So with these, we can derive relation for momentum and energy:
$$
\begin{align}
E^2 - p^2 c^2  =& \frac{ m^2 c^4  - m^2 v^2 c^2} {1 - v^2 / c^2}  \\
 = & \frac{  m^2 c^4 ( 1 - v^2 / c^2)} { 1 - v^2 c^2} \\ 
= & (m c^2)^2    \tag{3}\label{3}
\end{align}
$$
Physicist say for massless particle (photon) $E$ is indeterminate $0/0$ and the same also for momentum (you can have zero mass, provided you have same velocity with $c$ ). So equation $\ref{3}$ become
$$
E =  p c \tag{4} \label{4}
$$
But how we can say equation $\ref{4}$  is true whereas it is derived from (depend on) result in equation $\ref{3}$. If $m = 0$ then $E^2  = 0$ and $p^2  c^2 = 0$ too and it is become trivial identity $ 0 = 0$. 
And if we still forcing to use equation $\ref{4} $ we must remember that for photon, energy and momentum are indeterminate and can take any values, $E = 0/0$ and $p = 0/0$ so equation $\ref{4}$ become a strange form 
$$
0/0  = 0/0 
$$
LHS can be filled with any values, and also RHS, and it is inconsistencies in mathematical formulation. I can say that $5= 3$, $100 = 200$, $45 = 23$, etc.
 A: The best foundation for Special Relativity is not algebraic but geometric. To see the geometry clearly it's best to use units in which $c=1$. (We can always put the $c$'s back in later!)
In particular, let's start with the assumption that every particle has a four-momentum vector $$\vec{P}=\left<E,\vec{p}\right>\tag{1}$$
We assume that the Minkowski length of this vector can be interpreted (or defined, if you prefer) as the particle's mass $m$, so that (writing $p:=\left|\vec{p}\right|$)$$m^2=\left|\vec{P}\right|^2=E^2-p^2\tag{2}$$
We further assume that the velocity $\vec{v}$ of a particle satisfies $$\vec{v}=\frac {\vec{p}} {E}\tag{3}$$
These formulae are not only motivated geometrically, but they hold for both massive and massless particles, so there is no need for all those unconvincing $\frac {0}{0}$ arguments.
From these simple assumptions we can derive your formulae 1 and 2, which hold only for $m \gt 0$, $v \lt c$. I'll let you do the derivation (it's a good exercise to convince yourself), but to help you I'll put those dastardly c's back in...
$$\vec{P}=\left<\frac {E} {c},\vec{p}\right>\tag{1'}$$
$$m^2c^4=E^2-p^2c^2\tag{2'}$$
$$\vec{v}=\frac {\vec{p}c^2} {E}\tag{3'}$$
Your confusion arises from taking your formulae 1 and 2 as fundamental when they are not. They only hold for massive particles. For the general case (i.e. all particles) you should use the axioms I've stated and you won't run into trouble in the $m=0$, $v=c$ case like so many people (including textbook authors) do.
A: I will try to offer a heuristic argument for the assignemnt of energy as the zero component of the four-momentum.  (And I'll use units such that $c=1$, so that velocities are in fractions of the speed of light.)
First one should realise that there are really two aspects here. "Kinematic" variables, such as velocity, describe, say, the motion of particles -- all we need for these to make sense are some definitions of what we mean by position, time etc. Hence, in the transition from Galilean space and time to Minkowksi spacetime, these quantities change due to the differnet underlying structure, in particular Lortentz invariance.
On the other hand, "dynamic" quatities such as momentum, energy or mass are really only meaningful in the context of dynamical evolution laws, i.e. some equations that tell us how particles evolve in time, interact with each other etc. In particular, momentum is an important quantity in Newtonian mechanics because it is conserved in time due to the equations of motion. So we would need to specify some dynamical equation of motion, or equivalently an action, and see what are the conserved quatitied and how they compare with classical mechanics.
I will only look at the first part and assume that there is some dynamics that reasonably reduces to classical mechanics without specifying the details. Note that this Newtonian limit will only be reasonable for massive particles -- the state of massless particles is quite dubious here.
So assume a massive particle moves along the $x$ direction. In the coordinates of an intertial observer, its path and four-velocity would be 
$$ x^\mu=\left(t,v t, 0,0\right)\,,\quad u^\mu=\left(1,v,0,0\right)\,.$$
The square of the velocity, which is Lorentz invariant, is $u^2=1-v^2$. Now consider a second observer which moves along with the particle. The four-velocity accordeng to her, $w$, will be related to the first one by a Lorentz transformation, which in this case involves four parameters,
$$ w^\mu=\left(a(v) +b(v)\cdot v,a(v) \cdot v + b(v),0,0\right)\,.$$
(The fact that a Lorentz boost takes this form is left as an exercise at this point.) Since clearly $w_x=0$, we have $b=-a \cdot v$, so $w^\mu=\left(a(v)\left(1-v^2\right),0,0,0\right)$. Since Lorentz invariance demands $w^2=1-v^2$, we have $a=\gamma=1/\sqrt{1-v^2\,}$ and 
$$w^\mu=\left(\sqrt{1-v^2\,},0,0,0\right)\,.$$
Now there's really no point in having an arbitrary velocity $v$ in the four-velocity of a massive particle in its rest frame -- after all, we could have started the argument with the rest frame instead. Furthermore, these are coordinate expressions, not velocities with respect to eigentime. Thus, we'll divide the velocities by $\gamma$, and the final, heuristically reasonable, four-vector that generalises the velocity is
$$ u^\mu=\left(\frac{1}{\sqrt{1-v^2\,}},\frac{\vec{v}}{\sqrt{1-v^2\,}}\right)\,.$$
In the rest frame, this reduces to $(1,0,0,0)$, which makes sense - a stationary particle moves into the future at unit speed. However, the basic fact that, in the change from one reference frame to a boosted one, the $\gamma$ factor appears is simply a consequence of Lorentz invariance. Also note that $u^0\geq 0$ -- there is a minimum "$t$-speed".
Now the obvious guess for the four-momentum of a massive particle becomes $P^\mu=m u^\mu$, and that's what you have in the original question: It is a proper four-vector, and in the Newtonian limit its spatial part reduces to $m\vec v$. But what is $P^0$? Again, we can look at the low-speed limit $v\ll1$ -- then we have
$$\frac{m}{\sqrt{1-v^2\,}}\simeq m\left(1+ \frac{v^2}{2}\right)=m + \frac{p^2}{2m}\,,$$
an expression you can recognise as "rest energy" plus Newtonian kinetic energy. If you now additionally impose that, whatever dynamics govern mechanics in special relativity, Newtonian mechnics is recovered in this limit, you end up with the relativistic expression $P^\mu=\left(E,\vec{p}\right)$, and $P^\mu P_\mu=m^2$.
This argument doesn't work directly for massless particles. But we still get some information out: 
A particle moving with $v=1$ (i.e. speed of light) in one frame of reference does so in all of them (otherwise we would have $v^\mu=(0,0,0,0)$ in some frames). So there is no preferred rest frame, and the four velocity is always of the form $(\left|\vec u\right|,\vec u)$ for some three-velocity $u$. 
This already means that speed-of-light particles are not at all similar to usual massive particles: The "$t$-speed" $v^0$ can be made as small as we wish (but not zero). On the other hand, there is no obvious notion of energy or momentum for massless particles in Newtonian mechanics.
The plausible answer is then to assign a four-momentum $P^\mu=\left(E,\vec p\right)$ to massless particles, with $E^2={\vec p}^2$: It is a proper Lorentz four-vector and $P^\mu$ is proportional to $u^\mu$, and the energy-momentum relation fits with the one for massive particles. Of course, to argue that this is the energy of a massless particle, you have to fix the dynamics, i.e. an equation of motion or an action. 
In any case, the pairing of energy and three-momentum into a four-vector is the plausible one to get a proper Lorentz four-vector.
