Finding direction of a ball after collision in cartesian coordinate system In elastic collision of ball to wall along x axis
m*Vix=m*Vfx
as velocity of wall is 0 before and after collision thus
Vix=Vfx   ......eq(1)
Kinetic Energy is conserved so
m*Vi2 =  m*Vf2
(Vix2 + Viy2)= (Vfx2 + Vfy2)
According to equation 1
Vfy2 = Viy2
How do I conclude if Viy=-Vfy or Viy=Viy?
same is true for x component. 
As both equations hold true in different quadrant.  
if ball collides with a wall along y axis at origin with vector along the line (4,-4) (3,-3)...(x,-y) after collision ball will move along line (1,1)(2,2)..(4,4)..(x,y) magnitude is same but direction of y is changed.
if ball collides with a wall along x axis at origin with vector along the line (4,4) (3,3)...(x,y) after collision ball will move along line (-1,1)(-2,2)..(-4,4)..(-x,y) magnitude is same but direction of x is changed in this case.
I know I can find direction of y based on :-
 as Viy|=|Vfy| and  |Vix|=|Vfx|
if  Vix=Vfx  then Viy=-Vfy if it was not then ball will pass through the wall.
But my problem is I don't want to derive this based on logic or observation  but using maths or physics.
 A: In inelastic collisions, kinetic energy is not conserved, so I'm going to assume you mean a totally elastic collision since you say energy is conserved. O.K, so when the ball hits the wall, the speed of the wall before and after is 0, so that means the kinetic energy of the ball is conserved and thus the magnitude of the velocity is the same before and after for the ball, however we are dealing with vectors. What is the direction of the ball after the collision? 
Well if the ball hits at an angle perpendicular to the wall, the resulting velocity vector will have to be in the opposite direction as the initial velocity vector.
If it hits at an angle that is not 90 degrees, then you just break the velocity vector down into its components and after analysing the velocity vectors of the ball before and after, you will see that the velocity component perpendicular to the wall is in the negative direction from the initial one, while the other is parallel to the initial velocity vector. 
This agrees with the question in which the ball hits head on, as it only has one velocity vector component - and its perpendicular to the wall.  
