The commas in maths match commas from the default serif font but are taken from the OML encoding. You can see this if you force the text to use the serif font by changing the frame to
\begin{frame}
$f(x,y,z) > 0$ if {\rmfamily $x$, $y$,} and $z$ are positive.
\end{frame}

However, now the commas are being taken from the serif font while the rest of the text is taken from sans.
It would be better to ensure that the commas are taken from the same font as maths operators, since this is changed to the sans font by beamer, I think. For example:
\documentclass{beamer}
\DeclareMathSymbol{,}{\mathpunct}{operators}{"2C}
\begin{document}
\begin{frame}
$f(x,y,z) > 0$ if $x$, $y$, and $z$ are positive.
\end{frame}
\end{document}

The nice thing about this is that if you override Beamer's choices and insist it use serif rather than sans, your commas will still match your text:
\documentclass[serif]{beamer}
\DeclareMathSymbol{,}{\mathpunct}{operators}{"2C}
\begin{document}
\begin{frame}
$f(x,y,z) > 0$ if $x$, $y$, and $z$ are positive.
\end{frame}
\end{document}

Although the redefinition is unnecessary in this case, it is nice that you don't have to worry about removing or disabling it.
EDIT
In light of barbara's comment on the question, I ran a few tests. Although the particular punctuation suggested is unproblematic as it is already taken from operators rather than letters, the full stop is not. Moreover, there is a difference between the serif and sans full stop. In the sans font, it is square; in the serif, round.
Hence, for completeness, you might like to add a line redeclaring this symbol as well:
\documentclass{beamer}
\DeclareMathSymbol{,}{\mathpunct}{operators}{"2C}
\DeclareMathSymbol{.}{\mathpunct}{operators}{"2E}
\begin{document}
\begin{frame}
$f(x,y,z) > 0$ if $x$, $y$, and $z$ are positive.
$, . $ , . {\rmfamily , .}
\end{frame}
\end{document}
Here's the output for commas and full stops in maths and text, after the change, with the serif versions shown on the right for comparison.

$ $, likeif $x, y,$ and $z$ are positive.. – Carlos Viegas Jun 29 '15 at 11:55Beameruses always serif commas in math, even if I load it with the option[mathsans]... – crixstox Jun 29 '15 at 13:20operatorsrather than OML might have? – cfr Jun 29 '15 at 22:20beamermath to look likearticlemath – Werner Jun 29 '15 at 22:30!(for factorial). – barbara beeton Jun 30 '15 at 12:38!. – crixstox Jun 30 '15 at 15:58fontmath.ltxdefines the semicolon with\DeclareMathSymbol{;}{\mathpunct}{operators}{"3B}and the factorial with\DeclareMathSymbol{!}{\mathclose}{operators}{"21}. So those are already taken fromoperatorswhich I think is automatically set to sans or serif by Beamer according to the requested package options. The only problem is punctuation taken from e.g.lettersbecauselettersis configured for... – cfr Jul 01 '15 at 00:46