I have a question about the \displaystyle command

Christian has already shown examples of better markup, but I thought I'd answer your "absurdly small" comment.

$ is designed for inline math, that is, mathematics set within a paragraph of text. It attempts (not always successfully) to fit within the standard baseline spacing of a paragraph.

As the example shows, sometimes even the default settings are not cramped enough and the paragraph baseline is affected, but displaystyle opens up the paragraph with wildly inconsistent spacing making it more or less unreadable as a block of text.

enter image description here

\documentclass{article}

\usepackage{amsmath}


\begin{document}


A paragraph of text with $x^2+y^2=z^2$ some math(s).
Other examples might be $\frac{1}{2}\int_0^nx dx$
and $\sqrt{x}$.
A paragraph of text with $x^2+y^2=z^2$ some math(s).
Other examples might be $\frac{1}{2}\int_0^nx dx$
and $\sqrt{x}$.
A paragraph of text with $x^2+y^2=z^2$ some math(s).
Other examples might be $\frac{1}{2}\int_0^nx dx$
and $\sqrt{x}$.


\bigskip

\hrule
\bigskip

\everymath{\displaystyle}

A paragraph of text with $x^2+y^2=z^2$ some math(s).
Other examples might be $\frac{1}{2}\int_0^nx dx$
and $\sqrt{x}$.
A paragraph of text with $x^2+y^2=z^2$ some math(s).
Other examples might be $\frac{1}{2}\int_0^nx dx$
and $\sqrt{x}$.
A paragraph of text with $x^2+y^2=z^2$ some math(s).
Other examples might be $\frac{1}{2}\int_0^nx dx$
and $\sqrt{x}$.

\end{document}

I don't really recommend this, but \everymath{\displaystyle} is a way to achieve the display style for math content, i.e. for inline math content as well.

In my opinion the usage of the various align like environments should be preferred or \[...\].

Please consider also \dfrac{2}{3} for example as a 'nicer' way of displaying fractions.

As Zarko stated in comment: Using \displaystyle all the way will increase the spacing between the lines and leaves a disrupted look of the page.

Again: Don't do it.

\documentclass{book}

\usepackage{mathtools}

\begin{document}

$E=mc^2 = \frac{mc^2}{1}$


$\frac{2}{3}$ 

or

$\int_{0}^{\infty} e^{-5x}dx$. 

or

\[ \frac{2}{3} \]

or

\[ \int_{0}^{\infty} e^{-5x}dx \]


\everymath{\displaystyle}

$\frac{2}{3}$ 

or

$\int_{0}^{\infty} e^{-5x}dx$. 

\begin{align*}
\int_{0}^{\infty} e^{-5x}\mathrm{d}x &= \dots
\end{align*}


$\dfrac{2}{3}$


\end{document}