Demand Function And Inverse Demand Function Representation in Books Demand Function tells us how demand for a good varies as price varies. Inverse Demand Function is inverse of the demand function. Consider Q=210-3P , This is clearly demand function . So on X axis we should put price and on Y axis we should put Demand i.e quantity. But in all the books in demand function Price is Y axis. Shouldn't that be inverse demand function?(P=70-Q/3)
Any time demand function is specified as function of price $Q(p)$ and we plot it using convention that price $p$ belongs on y-axis and quantity $Q$ on x-axis the plot shows the inverse demand function. However, ‘inverse demand function’ is quite a mouthful and hence it will often be just abbreviated as demand.
Furthermore, there would be nothing necessarily wrong with plotting demand function with quantity being put on y-axis and price being put on x-axis. The graph would be equally valid but it would go against established convention.
Generally in science the convention is to put dependent variable on y-axis and independent variable on x-axis. In the case of demand the price and quantity are actually jointly determined and hence both variables could be considered dependent. However, this convention got established by Alfred Marshall in his influential Principles of Economics which was extremely popular economic textbook, and if you actually go over the book you will discover that Marshall often thought of price being determined by quantity  and consequently in his own mind at least he was just using the standard scientific convention of putting dependent variable on y-axis and independent on x-axis. Marshall book was so influential that the way how we plot supply-demand in present day textbooks is practically the same way.
There is actually already an excellent post discussing this notation on the history of science and mathematics stack exchange by user EconCow (the post also gives greater detail of the Marshall’s own position and further resources). As the user shows Marshall was not even the first one to plot price on y-axis and quantity on x-axis, and there also were in past economists that did exactly the opposite plotting. To be more specific the user provides examples for the following economists and ways how they arranged their graphs:

Augustin Cournot (1838). Price on horizontal axis.
Karl Rau (1841). Price on vertical axis.
Jules Dupuit (1844). Price on horizontal axis.
Hans von Mangoldt (1863). Price on vertical axis.
Fleeming Jenkin (1870). Price on horizontal axis.
...
William Stanley Jevons (1871, figure). Price on vertical axis.

The post I linked even shows the pictures of these graphs so I encourage you to have a look at it.
As you can see from the above at the begging people plotted demand in different ways. However, after Marshall's principles of economics profession decided to favor his convention and we continue using it to this day.