Yes, Y=X is a linear function. This is because a linear function posesses a constant slope. Y=X is actually in point slope form (y=mx+b) because Y = 1x+0. Therefore it is a linear equation.
(You may also look at the graph below, Y=X is a straight line which makes it a linear function)